Jump to content

Mysql sort question


guitarist809

Recommended Posts

Hello. I've got a little problem that I think is easy to resolve.

 

I'm grabbing a bunch of entries from a table with a date field (YYYY-MM-DD), but I only want one field per day

 

for example, I might have a few entries for 2005-03-25, but I only want the first of that.

 

I was looking at those JOIN things, but I couldn't figure them out.

 

 

 

Can anybody help me?

 

Thanks,

 

-Matt

Link to comment
Share on other sites

Not Necessairly.

 

Take this example of a table

 

[date]      [value]

[2007-1-1] [valueasdf]

[2007-1-1] [valuasdfe]

[2007-1-2] [valuade]

[2007-1-3] [vafalue]

[2007-1-3] [vadfalue]

[2007-1-3] [valdfue]

[2007-1-4] [valsdfaue]

[2007-1-4] [valdsue]

[2007-1-5] [valfdue]

[2007-1-8] [valsfue]

 

I just want MySQL to return this

[2007-1-1] [valueasdf]

[2007-1-2] [valuade]

[2007-1-3] [vafalue]

[2007-1-4] [valsdfaue]

[2007-1-5] [valfdue]

[2007-1-8] [valsfue]

 

Notice how none of the dates are the same.

I dont care what it returns, just as long as there are no equal dates.

The reason I dont care is because i'm not taking the value, its just counting each day.

Link to comment
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.