If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > max of N records

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-06, 06:03
venkat_lvr venkat_lvr is offline
Registered User
 
Join Date: Aug 2005
Posts: 19
max of N records

Hi....

i'm new for mysql , I want to get max of N records from a table and i want process the N records one by one , so I used one cursor ..


declare cursorname cursor for select x,y from tablename where y='11'
order by x desc limit 4;

if I'm give like this na its working .....

but limit of N is Given by User so I modify like this

declare cursorname cursor for select x,y from tablename where y='11'
order by x desc limit N;

If i'm give like this na it gives error

pls Give Solution


Thanks,
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On