Jump to content

[SOLVED] Query help


haku

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.