can i write a query like this..
select * from X where
X . a , X . b in (select a,b from C where <condition> )
regards
sunny
SELECT X.*
FROM SomeTable X
INNER JOIN (select a,b from C where <condition> ) Y ON X.a = Y.a AND X.b =
Y.b
--
Keith, SQL Server MVP
Quote:> can i write a query like this..
> select * from X where
> X . a , X . b in (select a,b from C where <condition> )
> regards
> sunny
select * from X where
X . a , X . b in (select a,b from C where <condition> )
------------
Can i write the above query like this.. ( i dont want to use joins as it is
a bit complex query only a part of which i had sent to you)
Will the below solution return the same results as i need in the above one
select * from X where
(exists (Select a, b from table1 w where <condition1> and X.b = w.b and
X.a = w.a ))
Thanks & regards
sunny
> SELECT X.*
> FROM SomeTable X
> INNER JOIN (select a,b from C where <condition> ) Y ON X.a = Y.a AND X.b =
> Y.b
> --
> Keith, SQL Server MVP
> > can i write a query like this..
> > select * from X where
> > X . a , X . b in (select a,b from C where <condition> )
> > regards
> > sunny
1. Query using UDF joined to a sub query vs Temp Table to sub Query
I have a simple query question. Currently I have a query that joins a UDF that returns a table to a sub query of a number of secondary tables. This query seems to run forever, but if I dump the results of the udf into a temp table and use joined to the sub query the results are as expected. Can anyone shed some light onto why? Also is it possible to use the UDF in this manner with possible join hints to get the query return time I'm looking for?
2. stored procedure writing to a file
4. msmq and ado recordset persistance
6. FL-Sarasota-OPM/Gemms Functional/Technical Resources
7. Subject: SQL Query - MAX, Grouping and Sub query
9. access query converted to sql7 query
10. Part of query in query result
11. Newbie: Access97 query to SQL Server 7 query
12. Simple queries versus complex queries