![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can someone tell me where my syntax is wrong in the following SQL statement. It's something to do with the use of the TOP keyword: |
|
SELECT distinct top 1 * from calldetails order by calldate desc I am trying to order the table by calldate and them select the most recent record. |
#3
| |||
| |||
|
|
"Andrew Chalk" <achalk (AT) magnacartasoftware (DOT) com> wrote in message news:qseCf.28240$PL5.22263 (AT) newssvr11 (DOT) news.prodigy.com... Can someone tell me where my syntax is wrong in the following SQL statement. It's something to do with the use of the TOP keyword: Right -- TOP is not a keyword in MySQL or in standard SQL. This is a proprietary extension to the SQL language, implemented in Microsoft SQL Server 7 and later. SELECT distinct top 1 * from calldetails order by calldate desc I am trying to order the table by calldate and them select the most recent record. You can do this in MySQL as follows: SELECT DISTINCT * FROM calldetails ORDER BY calldate DESC LIMIT 10 See http://dev.mysql.com/doc/refman/5.0/en/select.html Regards, Bill K. |
![]() |
| Thread Tools | |
| Display Modes | |
| |