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
 General SQL Server Forums
 New to SQL Server Programming
 cross join

Author  Topic 

mukhan85
Starting Member

46 Posts

Posted - 2008-07-29 : 16:40:30
Hi, I am getting the following error for the query below:
Server Message: Number 102, Severity 15
Server 'ARREPROD', Line 10:
Incorrect syntax near 'CROS'.
Server Message: Number 156, Severity 15
Server 'ARREPROD', Line 23:
Incorrect syntax near the keyword 'as'.

QUERY:

SELECT
sub2.am_value,
sub1.metric_value
FROM
(
SELECT 'Successful' AS metric_value union
SELECT 'Successful with Issues' AS metric_value union
SELECT 'Unsuccessful' AS metric_value union
SELECT 'Backed Out' AS metric_value union
SELECT 'No Closure Stat (Completed)' AS metric_value
) as sub1 CROSS JOIN (
select '1' as am_value union all
select '2' as am_value union all
select '3' as am_value union all
select '4' as am_value union all
select '5' as am_value union all
select '6' as am_value union all
select '7' as am_value union all
select '8' as am_value union all
select '9' as am_value union all
select '10' as am_value union all
select '11' as am_value union all
select '12' as am_value
) as sub2

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-29 : 16:45:05
I'm not getting any syntax errors when I check for them in SQL Server 2005.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-29 : 21:53:23
quote:
Server Message: Number 102, Severity 15
Server 'ARREPROD', Line 10:
Incorrect syntax near 'CROS'.
Server Message: Number 156, Severity 15
Server 'ARREPROD', Line 23:
Incorrect syntax near the keyword 'as'.

Are you using Microsoft SQL Server ? MS SQL does not show server name on the error message.




KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-29 : 21:56:23
Oh ! Just saw your the other DUPLICATE thread http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=107028

Please post your Sybase question over at sybase.com. This is a Microsoft SQL Server forum.

I guess OP post back here because dbforums.com is down again.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-29 : 22:07:41
Sybase supports Cross join.
Go to Top of Page
   

- Advertisement -