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 > Interesting mysql query ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-04, 06:07
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
Interesting mysql query ?

Hi,

select *from test1 a inner join test1 b on a.id = b.id1 limit 2

The above query returns the subset (first 2 rows) from the join result.
But, I need a query in mysql, where in the 'limit' should happen first and then from that 'JOIN' should be performed and result should be returned.

i.e First two rows of the table test1 shoule be selected first and then the given join should be applied to this first two rows and it should be returned. How to do this with mysql query ?

Thanks,
Sam
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