What Is LIMIT? and How to Use LIMIT?

2004-04-01 Thread Caroline Jen
I saw somebody has MySQL statement this way: StringBuffer sql = new StringBuffer(512); sql.append(SELECT ThreadID, ForumID, MemberName, LastPostMemberName, ThreadTopic, ThreadBody); sql.append( FROM + TABLE_NAME); sql.append( ORDER BY + sort + + order);

Re: What Is LIMIT? and How to Use LIMIT?

2004-04-01 Thread Johan Hook
Hi, I guess this is for a java.sql.PreparedStatement as the '?' seem to indicate that. LIMIT limits ;-) the number of rows retrieved, i.e. LIMIT 10, 20 gives you 20 rows starting at row 20 in the resultset and LIMIT 10 gives you the first 10 rows. See: http://www.mysql.com/doc/en/SELECT.html