Jump to content

Recommended Posts

I have a table with the following columns: nid, vid, title

 

vids are all unique, but nids are often not. So for example I may have:

 

nid vid title

1    2  ta

1    3  tb

2    4  tc

2    5  td

 

I need to select the title for each nid that corresponds to the highest vid. For example, in the above example, I want two titles - one for each of the nids, and the two titles I want are tb and td, as they correspond to the highest vid values for each nid.

 

Can someone give me a hand on this? I've been playing with it for a while, but it's not working for me. Gracias.

 

Link to comment
https://forums.phpfreaks.com/topic/168931-solved-query-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.