|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-11-20 : 03:42:45
|
| my current query isselect p.productid,p.productname,p.manufacturerid,p.manufacturersku,p.description,p.shortdescription,p.keywords,p.weight,p.weightunit,p.productlength,p.productwidth,p.productheight,p.dimensionunits,o.cost,o.price as unitprice,o.listprice as listprice,p.quantityinstock,p.stockdisplay,o.shippingprice,p.taxable,p.productlink,p.callforprice,p.callforpricemessage,p.active,p.deleted,p.dateadded,p.datedeleted,p.minimumstocklevel,p.featuredincategories,p.handlingfeeid,p.specs,p.itemincludes,p.surcharge,p.freeshipping,p.availability,p.metakeywords,p.metadescription,p.nohtmldesc,o.optionname,o.variantsku as merchantsku,o.optionid,o.image from products p left join productstooptiongroups ptg on p.productid=ptg.productid left join options o on o.optiongroupid=ptg.optiongroupid problem is there are some products that don't have any record in the productstoptionsgroups (no options)for these products i need to take the listprice and unitprice from products and not options -- how can i do this? like if the options exist the listprice is the price field from options and if not then it's the listprice field from products? |
|