Monday, March 26, 2012

Query

Guys,
New to SQL programming and would like to know can we use the result of
2 queries in one?
Eg,
Parts as a query
Spares as a query
Can I use the results of these 2 queries
SELECT parts.*, spares.*
FROM Parts, Spares
can you pls help?
Thanks in advance
rgds
tdYour question is rather vague so only a general answer is possible. I think
you will want to use either a UNION or a JOIN. The example query you posted
is actually a CROSS JOIN, which probably isn't what you intended but that
depends what you mean by "use the result of 2 queries".
If you need more help then please read the following article, which explains
how you can best describe your problem for the group:
http://www.aspfaq.com/etiquette.asp?id=5006
David Portas
SQL Server MVP
--

No comments:

Post a Comment