Re: SQL Question
anonymous_at_discussions.microsoft.com
Date: 09/04/04
- Next message: Hilary Cotter: "Re: Full-Text population"
- Previous message: Chieftonw: "Update statment with two databases"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 4 Sep 2004 11:16:53 -0700
Thanks a lot!!!
>-----Original Message-----
>>>
>WITH temp (var1 var2) as
>(
>select field1, field2
>from table1
>)
><<
>
>above syntax's equivalent in sql server is:
>
>select field1 as var1,field2 as var2 into temp from table1
>
>--the query remain the same :
>select tb1.field2, tb2.var2
>from
>temp as tb1,
>table2 as tb2
>where
>tb1.var1 = tb2.field1
>
>--using ansi syntax you can have query as:
>
>select tb1.var2, tb2.var2
>from temp as tb1 join table2 as tb2
>on tb1.var1 = tb2.field1
>
>--without creating the temporary table you can make use
of SELECT statement
>as an inline view as follows:
>
>select tb1.field2, tb2.var2
>from (select field1,field2 from table1) as tb1 join
table2 as tb2
>on tb1.field1 = tb2.field1
>
>
>--
>Vishal Parkar
>vgparkar@yahoo.co.in | vgparkar@hotmail.com
>
>
>.
>
- Next message: Hilary Cotter: "Re: Full-Text population"
- Previous message: Chieftonw: "Update statment with two databases"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|