Results 1 to 7 of 7

Thread: [RESOLVED] MSSQL guy has a MySQL statement.... question.

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    28

    [RESOLVED] MSSQL guy has a MySQL statement.... question.

    Hey guys. This question is here because it seems that the MySQL gurus would hang out in here AND most of focus in the Database forum is centered around MSSQL.

    I've recently picked up PHP/MySQL for a couple of projects that I'm working on. One problem that I seem to be having is that I want to return a top 10 list of sorts into a list box. The statement that I've written works great in a MSSQL database that I use for testing, but when I try to execute the statement on my webserver I get an incorrect syntax error. Any ideas on where my syntax has gone wrong? Here is my MSSQL statement.
    Code:
    SELECT TOP 10 COUNT(*) as Total, Title FROM ggListAvailable GROUP BY Title ORDER BY Total DESC
    I'm wondering if it's the TOP keyword or perhaps the Alias. Are these guys supported in MySQL? I looked through the MySQL manual and didn't find anything on the TOP command. If the above statement will not work in MySQL, what suggestions would you have for doing the same thing? Thanks in advance for any help guys.
    Last edited by setaside; Jan 30th, 2003 at 02:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width