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 > Can anyone help with this problem?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-27-05, 10:27
Chupacabras Chupacabras is offline
Registered User
 
Join Date: Sep 2005
Posts: 2
Can anyone help with this problem?

Can anyone help with this problem?

http://www2.gi-bon.sk/problem.html
Reply With Quote
  #2 (permalink)  
Old 09-27-05, 11:12
tombell tombell is offline
Registered User
 
Join Date: Jun 2005
Posts: 23
Try this, for mysql 4.1.x
Code:
SELECT
 row_id,
 doc_id,
 version,
 body
FROM
 documents d
WHERE row_id=
  (SELECT
     MAX(row_id)
     FROM
     documents d1
     WHERE d1.doc_id=d2.doc_id)
Reply With Quote
  #3 (permalink)  
Old 09-28-05, 06:51
Chupacabras Chupacabras is offline
Registered User
 
Join Date: Sep 2005
Posts: 2
thanks for reply, tombell

it works!

(it didn't work on mysql 4.0.x, then i installed mysql 5.0.x and your solution worked exactly as i wanted to)

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