Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How LIMIT MySql Query to top 10 rows - Error in SELECT clause: expression near '10'. Unable to parse query text.

Avatar of RobertNZana
RobertNZanaFlag for United States of America asked on
MySQL ServerASP.NET
12 Comments1 Solution1776 ViewsLast Modified:
Using latest versions of both ASP.NET and MySQL.  I want to create a query returning only the TOP 10 rows of data, but using LIMIT does not seem to work.  (This is a query within an XSD dataset.)

I've tried:
LIMIT 10
LIMIT 0,10
Putting the LIMIT after the WHERE and after the ORDER BY

The TableAdapter Query Configuration Wizard tells me:  Error in SELECT clause: expression near '10'. Unable to parse query text.

What am I missing?
SELECT     counties.County, states.UsStateAbbreviation, projects.ProjectId, projects.ProjectTitle
FROM         states INNER JOIN
                      counties ON states.StateId = counties.StateId INNER JOIN
                      projects ON counties.CountyId = projects.LocationCountyId
LIMIT 10
WHERE     (projects.IsVisible = 1) AND (projects.ReleaseDate <= CURDATE()) AND (projects.IsPrivate = 0)
ORDER BY projects.BidDateTime DESC
ASKER CERTIFIED SOLUTION
Avatar of fabioce
fabioceFlag of Italy image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answers