[thelist] help with tricky select statement

Michael Robertson mike at mikeemedia.com
Fri Jul 19 23:19:00 CDT 2002


BTW--this is using SQL Server 2k


----- Original Message -----
From: "Michael Robertson" <mike at mikeemedia.com>
To: <thelist at lists.evolt.org>
Sent: Friday, July 19, 2002 10:53 PM
Subject: [thelist] help with tricky select statement


> 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?
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>




More information about the thelist mailing list