Jump to content

Question about queries


EchoFool

Recommended Posts

Hey, quick question..

 

 

Said i have rows with time stamps... now rows can have an ID but many can have the same if they are related to the same thing.

So what i want to do is get one of each record ID which is the youngest. How would i go about doing something like that?

 

Example:

 

1)Record  3 - 12/04/04

2)Record 3 - 12/04/05

3)Record 4 - 12/04/05

 

So the two that it will return is :

Record 3  (The second one in the list)

Record 4 as this is different entirely to the record 3's.

Link to comment
https://forums.phpfreaks.com/topic/86133-question-about-queries/
Share on other sites

RecordID is the ID of the forum thread.

 

The list above would represent the posts in the thread so :

 

 

RecordID |  Text  |  posted on  |  PrimaryID |

  3          |  test  |  12/04/04  |    23232 |

 

So its not uncommon that there will be two of the RecordID but the query is needing to find the "youngest" by finding the youngest "posted on" time stamp.. the above is just an example of my idea.

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.