|
 |
asp_databases thread: Old SQL Syntax
Message #1 by Kevin_Riggs@p... on Tue, 13 Jun 2000 07:35:29 -0400
|
|
Anyone remember the old syntax for a Right Outer Join?
Had it working yesterday and mistyped it today. Must have forgotten
overnight?!?
Something like:
FROM tablename1, tablename2
tablename1.fieldname =* tablename2.fieldname
WHERE (tablename1.fieldcriteria=11OR tablename1.fieldcriteria IS NULL) AND
(tablename1.fieldcriteria2=1 OR tablename1.fieldcriteria2 IS NULL)
The only thing I'm missing (I think) is the keyword in front of my Right Outer
Join representation (line with =*). Like I say, we had this working yesterday.
Funny thing is that we've never gotten the point&click interface for SQL Server
7.0 to return the recordset we wanted using the Outer Join feature.
Thanks for the help,
KD
Message #2 by mkrishna - Internet Mail <mkrishna@c...> on Tue, 13 Jun 2000 09:26:55 -0400
|
|
in oracle it is a "+" sign...
> -----Original Message-----
> From: Kevin_Riggs
> Sent: Tuesday, June 13, 2000 7:35 AM
> To: ASP Databases
> Subject: [asp_databases] Old SQL Syntax
>
>
>
> Anyone remember the old syntax for a Right Outer Join?
>
> Had it working yesterday and mistyped it today. Must have forgotten
> overnight?!?
>
> Something like:
>
> FROM tablename1, tablename2
> tablename1.fieldname =* tablename2.fieldname
> WHERE (tablename1.fieldcriteria=11OR tablename1.fieldcriteria IS NULL) AND
> (tablename1.fieldcriteria2=1 OR tablename1.fieldcriteria2 IS NULL)
>
> The only thing I'm missing (I think) is the keyword in front of my Right
> Outer
> Join representation (line with =*). Like I say, we had this working
> yesterday.
> Funny thing is that we've never gotten the point&click interface for SQL
> Server
> 7.0 to return the recordset we wanted using the Outer Join feature.
>
> Thanks for the help,
>
> KD
>
Message #3 by Kevin_Riggs@p... on Tue, 13 Jun 2000 09:07:12 -0400
|
|
Got it!
For some reason, having the point&click interface open in SQL Server Enterprise
Manager caused SQL Server to want to rewrite my SQL statement.
The correct answer is:
FROM table1, table2
WHERE
table1.field1 =* table2.field1
AND
((table1.criteria1 = 11 OR table1.criteria1 IS NULL))
AND
((table2.criteria1 = 1 OR table1.criteria1 IS NULL))
KD
|
|
 |