Forums
This topic is locked
SQL code for the following tables
Posted 17 Dec 2005 00:59:20
1
has voted
17 Dec 2005 00:59:20 johonas johonas posted:
Two tables:table1
Columns ID Name Phone
R1 Bill 447-2234
R2 Ted 333-2313
R3 Ron 442-4232
table2 ID CustID Code
1 R1 111
2 R2 MM
3 R2 111
4 R3 211
5 R3 MM
6 R1 211
7 R2 211
I need a single SQL statement for a ASP page that returns all Names and Phone #'s of everyone in table1 that does not have a 'MM' associated with them in table2 ie. Bill (407) 695-1759. Note in table2 column Code 'MM' is one of a possible 100 codes. I'm kinda new to this thing and I really could use some help.
Replies
Replied 28 Dec 2005 09:11:34
28 Dec 2005 09:11:34 Tjerk Heringa replied:
Hi,
This is a fairly simple query.
You should be able to find the code in minutes if you browse 1 or 2 SQL sites.
If you take the time to find things out you will learn about SQL too.
Give a man a fish and he isn't hungry for a day. Teach him to fish and you will feed him a lifetime.
Do yourself this favor.
----------------------------------------------
The client is allways right even if he is not.
This is a fairly simple query.
You should be able to find the code in minutes if you browse 1 or 2 SQL sites.
If you take the time to find things out you will learn about SQL too.
Give a man a fish and he isn't hungry for a day. Teach him to fish and you will feed him a lifetime.
Do yourself this favor.
----------------------------------------------
The client is allways right even if he is not.