Dear friends:
I have the following case that I am requiring the convenient SQL to access the data.(It's been more than 3 days working)
I am using Sybase 5.5.5, I have tried many many SQL statements that sometimes run right, sometimes wrong (which is very weird!).
my sql statement is:
the database schema is found at:
it may happen that some products do not have data in product_port table, which i would like to show their portid as null, even the remaining required fields as null if they don't exist.
Example
the result that I want to see is when the product does not have any entry in the Printer_port table I want the remaining fields to be null as shown in:
Thank you for your help.
I have the following case that I am requiring the convenient SQL to access the data.(It's been more than 3 days working)
I am using Sybase 5.5.5, I have tried many many SQL statements that sometimes run right, sometimes wrong (which is very weird!).
my sql statement is:
Code:
select ph.tim,u.name,pd.quan,p.descript,p.modifier,pp.portid,ps. printertype,ps.connectedtostation,ps.comport,pd.uniqueid,p.modifier
from products p,station_printer_port sp,product_port pp,printers ps, posdetail pd,posheader ph,userse u
where ph.transact=pd.transact and ph.userid=u.id and pd.prodnum=p.prodnum and p.prodnum*=pp.prodnum and pp.portid*=sp.portid and
sp.printerid=ps.id and ps.connectedtostation=1 and pd.transact=135 order by pd.uniqueid asc
the database schema is found at:
it may happen that some products do not have data in product_port table, which i would like to show their portid as null, even the remaining required fields as null if they don't exist.
Example
the result that I want to see is when the product does not have any entry in the Printer_port table I want the remaining fields to be null as shown in:
Thank you for your help.