[thelist] help with tricky select statement

Michael Robertson mike at mikeemedia.com
Fri Jul 19 21:52:02 CDT 2002


working within one table where user may have more than one record. Trying to
ultimately get the weight from first entry and weight from 2nd entry where
emp_num is the common bond between the 2 records. This is as far as a i got.
This works, but if switch to second statement i get an error

select user_id,emp_num
from tbl_user_data t1
where entry_num='1'
 and emp_num=(select emp_num from tbl_user_data t2
   where entry_num='2' and t2.emp_num=t1.emp_num)


select user_id,emp_num
from tbl_user_data t1
where entry_num='2'
 and emp_num=(select emp_num from tbl_user_data t2
   where entry_num='1' and t2.emp_num=t1.emp_num)


is there a way i can say get weight from first and get weight from second
record from tbl_user_data where emp_num is the same?





More information about the thelist mailing list