Skip to content Skip to sidebar Skip to footer

How To Create A Table Then Commit Then Insert Then Commit And Drop Table?

Hi I am having a problem committing to a database. I am very new to Firebird SQL. But I have a query that creates a table, then commits it, then inserts it, commits it, view the

Solution 1:

Would it not be easier to create a view, and then select from it whenever you need to?

createview vw_customCollections asSELECTDISTINCT
part.num
,part.description
,COALESCE(grlmin.info,'Undefined')
,getLexile.lexile_level
,COALESCE(fnf.info,'')
,SUM(tag.qty)
,vendor.name
,customvarcharlong.info
,cast(product.price asdecimal(10,2))
FROM PART
LEFTJOIN customset AS grlmin ON grlmin.recordid = part.id AND grlmin.customfieldid =51-- guided reading level minimumLEFTJOIN getLexile on getLexile.lexile_partid = part.id and getLexile.lexile_partid =61-- lexile levelLEFTJOIN vendorparts on vendorparts.partid = part.id
LEFTJOIN vendor on vendor.id = vendorparts.vendorid
LEFTJOIN customset AS fnf on fnf.recordid = part.id AND fnf.customfieldid =47-- fiction/nofictionLEFTJOIN tag on part.id = tag.partid
LEFTJOIN customvarcharlong on customvarcharlong.recordid = part.id and customvarcharlong.customfieldid =56-- languageLEFTJOIN product on product.partid = part.id
LEFTJOIN customset as resourceType on resourcetype.recordid = part.id
where vendorparts.defaultflag =1and resourcetype.info ='Book'GROUPBY part.num,part.description, COALESCE(grlmin.info,'Undefined'), COALESCE(fnf.info,''),getLexile.lexile_level, vendor.name, customvarcharlong.info,product.price
HAVINGSUM(tag.qty) >0

then:

select *
from   vw_customCollections
orderby  part_number

Post a Comment for "How To Create A Table Then Commit Then Insert Then Commit And Drop Table?"