Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-03-28 : 07:13:24
|
| harish maheshwari writes "Hello. Suppose there is a two tables named A & B . Fields of A are like this : userId, age Fields of B are like this : userId, address now i want to display all those user's addresses who have the age below 21. plz guide me...Harish" |
|
|
samsekar
Constraint Violating Yak Guru
437 Posts |
Posted - 2003-03-28 : 08:05:55
|
| TRY THIS:SELECT A.USERID,A.AGE,B.ADDRESS FROM A, B WHERE A.USERID=B.USERID AND A.AGE<21Sekar~~~~Success is not a destination that you ever reach. Success is the quality of your journey.Edited by - samsekar on 03/28/2003 08:06:39 |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-28 : 08:18:57
|
Sekar's join syntax will not be supported in versions of SQL Server moving foward. You should be using the ANSI style joins.select a.userid, a.age, b.addressfrom a inner join b on a.userid = b.useridwhere a.age < 21 Jay White{0} |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-03-28 : 08:20:34
|
quote: Sekar's join syntax will not be supported in versions of SQL Server moving foward. You should be using the ANSI style joins.
That's probably the answer to his NEXT homework question .... - Jeff |
 |
|
|
samsekar
Constraint Violating Yak Guru
437 Posts |
Posted - 2003-03-28 : 08:42:21
|
quote: Sekar's join syntax will not be supported in versions of SQL Server moving foward. You should be using the ANSI style joins.
Thanks Jay. I will not do that again. Sekar~~~~Success is not a destination that you ever reach. Success is the quality of your journey. |
 |
|
|
LarsG
Constraint Violating Yak Guru
284 Posts |
Posted - 2003-04-06 : 14:39:24
|
| The syntax used by samsekar is ANSI compliant, so that is not a reason for not using it. What microsoft has stated is that their propriatary syntax for outer join, e.g.where a =* bwill become obsolete. This misunderstanding seems to be all to common. |
 |
|
|
|
|
|