Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 nested queries

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-31 : 09:05:47
Tim writes "I know in Oracle, it's easy to have a query such as:


SELECT column1
FROM (SELECT column1, column2
FROM table1
WHERE column1 > 10)


I can't figure out how to query from another query like this example in MS SQL Server. Any help? I'm using Management Console 1.2 Version 5.0 (so it says in the About... window)."

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2002-05-31 : 09:08:25
So close... you need to alias your derived table.


SELECT column1
FROM (SELECT column1, column2
FROM table1
WHERE column1 > 10) mytable


Justin


Go to Top of Page
   

- Advertisement -