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.
Code:
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
Code:
#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