Subject | sql problem |
---|---|
Author | s.beames@mailbox.gu.edu.au |
Post date | 2001-04-26T01:49:32Z |
G'day,
could someone put me out of my misery and explain why this cut-down
SQL statement returns the same (first) value for CAT1NUM for every
row of the table (even though they ARE different)?
SELECT ITEMUSED_ID
, JOBNO
, ITEMNO
, QTY
, (SELECT CAT1NO FROM ITEMS WHERE ITEMS.ITEMNO=:ITEMNO)
AS CAT1NUM
, (SELECT CAT1 FROM CATEGORY1 WHERE CATEGORY1.CAT1NO=:CAT1NUM)
AS CAT1
FROM ITEMSUSED
ITEMUSED_ID is in KeyLinks
Can I use :ITEMNO like this?
Thanks,
Steve
could someone put me out of my misery and explain why this cut-down
SQL statement returns the same (first) value for CAT1NUM for every
row of the table (even though they ARE different)?
SELECT ITEMUSED_ID
, JOBNO
, ITEMNO
, QTY
, (SELECT CAT1NO FROM ITEMS WHERE ITEMS.ITEMNO=:ITEMNO)
AS CAT1NUM
, (SELECT CAT1 FROM CATEGORY1 WHERE CATEGORY1.CAT1NO=:CAT1NUM)
AS CAT1
FROM ITEMSUSED
ITEMUSED_ID is in KeyLinks
Can I use :ITEMNO like this?
Thanks,
Steve