MySQL Forums
Forum List  »  Microsoft SQL Server

Why won't this SqlServer query work with mysql?
Posted by: James Spibey
Date: February 10, 2005 04:02PM

Hi,

I have a table called 'myTable' which consists of two fields, field_id (int) and time (DateTime). I have a query which works fine in SqlServer which won't work in MySql.

select *, (select count(*) + 1 from myTable t where t.time < m.time) as Rank from myTable m order by Rank desc

The query is supposed to display a list of times with a ranking. When I run the above query I get an error

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(*) + 1 from myTable t whe

Can anyone help me?

Cheers

Options: ReplyQuote


Subject
Written By
Posted
Why won't this SqlServer query work with mysql?
February 10, 2005 04:02PM
February 13, 2005 03:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.