Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql query 1

Status
Not open for further replies.

dekanus

Programmer
Apr 6, 2005
3
SE
I have this simple query in access:

SELECT Node_Interfaces.NODE_ID, Node_Interfaces.Interface
FROM Node_Interfaces INNER JOIN temp_test ON Node_Interfaces.NODE_ID = temp_test.NODE_ID;

which I'd like to use in an asp page. I want to query for all Interfaces that has the same NODE_ID as in the temp_test query. The problem is I don't know how to query a query in sql. Can anyone help?
 
how to query a query in sql
SELECT Node_Interfaces.NODE_ID, Node_Interfaces.Interface
FROM Node_Interfaces INNER JOIN (
SELECT instruction of temp_test query
) temp_test ON Node_Interfaces.NODE_ID = temp_test.NODE_ID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
works great cheers mate! Came by another problem though:
How do I go about when I want to sort on a field in the subquery(temp_test)? In access I'd only add
ORDER BY temp_test.whatever but how do I access a field in the subquery to sort on?

Thanks
 
ooops silly me I just found out how sorry for wasting space :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top