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.
| Author |
Topic |
|
ccdavies
Starting Member
11 Posts |
Posted - 2012-05-24 : 11:29:09
|
Hi all.Can anyone see my mistake here:SELECT data.entry_id AS entry_id_f FROM exp_channel_data AS data WHERE field_id_73 = 'yes' LIMIT 0, 1 ORDER BY 1 DESC It keeps showing an error of: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 'ORDER BY 1 DESC' at line 1and I cant find the issue.Thank you |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2012-05-24 : 11:39:44
|
| Yes, you are not using SQL Server..Otherwise, I would guess its your LIMIT syntax. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-24 : 15:07:00
|
quote: Originally posted by ccdavies Hi all.Can anyone see my mistake here:SELECT data.entry_id AS entry_id_f FROM exp_channel_data AS data WHERE field_id_73 = 'yes' LIMIT 0, 1 ORDER BY 1 DESC It keeps showing an error of: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 'ORDER BY 1 DESC' at line 1and I cant find the issue.Thank you
The error message clearly states you're using MySQL. Please post in some MySQL forums like one at www.dbforums.com to get correct syntax specific help. This is MS SQL Server forum and we deal only with T-SQL related issues------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
ccdavies
Starting Member
11 Posts |
Posted - 2012-05-24 : 15:40:06
|
| Sorry guys. I am new to this stuff, didnt even realise it was different :PThank you for the link! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-24 : 15:43:07
|
| no problemyou're welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-05-30 : 05:07:27
|
It is other way. LIMIT should follow ORDER BYSELECT data.entry_id AS entry_id_f FROM exp_channel_data AS data WHERE field_id_73 = 'yes' ORDER BY 1 DESC LIMIT 0, 1 MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|