|
Home > Archive > Microsoft SQL Server forum > July 2005 > cascaded select
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| 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
| |
| Razvan Socol 2005-07-02, 7:23 am |
| 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
| |
|
| Thanks a lot !!!
working for several month only with oracle made me totally forgot that.
regards
Mark
"Razvan Socol" <rsocol@gmail.com> schrieb im Newsbeitrag
news:1120295724.860959.260300@z14g2000cwz.googlegroups.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
>
|
|
|
|
|