471,073 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

cascaded select

Hello,

how to do a select ... from select in MSSQL similar to Oracle? eg.

select hour
from (
select substring( daily, 9,2 ) as hour
from daytab
where userid = 12
)

results in "incorrect syntax near ')'"

thank you and regards
Mark
Jul 23 '05 #1
2 13109
Hello, Mark

In SQL Server (and in ANSI SQL-92), the derived tables (subqueries used
in the FROM clause) need an alias:

select hour
from (
select substring( daily, 9,2 ) as hour
from daytab
where userid = 12
) A

Razvan

Jul 23 '05 #2
Thanks a lot !!!
working for several month only with oracle made me totally forgot that.
regards
Mark
"Razvan Socol" <rs****@gmail.com> schrieb im Newsbeitrag
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello, Mark

In SQL Server (and in ANSI SQL-92), the derived tables (subqueries used
in the FROM clause) need an alias:

select hour
from (
select substring( daily, 9,2 ) as hour
from daytab
where userid = 12
) A

Razvan

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JT | last post: by
1 post views Thread by Michael Blackney | last post: by
1 post views Thread by serena.delossantos | last post: by
6 posts views Thread by Apaxe | last post: by
6 posts views Thread by dbuchanan | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.