Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Better approach for this query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 08/13/2008 :  15:39:59  Show Profile  Reply with Quote
The follwoing sql works but I am looking for a better approach for doing this without using:
from tbl1 a
join tbl2 b
on =

select distinct,,
from tbl1 a
join tbl2 b
on =
where b.ID IN 1,2,3
and a.emailaddress in
select distinct emailname from bulkuserupload

The dataset would be:
id1 id2 createdby createddate
1 1 1234 12/1/2005
1 2 1234 12/1/2005
1 3 1234 12/1/2005
1 1 1234 12/1/2005
1 2 1234 12/1/2005
1 3 1234 12/1/2005

Thanks in advance for you input.

Posting Yak Master

United Kingdom
122 Posts

Posted - 08/14/2008 :  04:41:11  Show Profile  Reply with Quote
Can you copy-paste the actual code you're using... The above will produce syntax errors.

Oh and while you're doing that, read this:

Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 08/14/2008 :  14:40:05  Show Profile  Reply with Quote
Not sure what you're trying to do the join condition is wrong = please post correct query or provide some sample data & explain.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000