3 messages in com.mysql.lists.mysqlRE: query question| From | Sent On | Attachments |
|---|---|---|
| jabb...@abbotts.org | 27 Apr 2005 13:23 | |
| mathias fatene | 27 Apr 2005 13:55 | |
| Peter Brawley | 27 Apr 2005 14:04 |
| Subject: | RE: query question![]() |
|---|---|
| From: | mathias fatene (mfat...@free.fr) |
| Date: | 04/27/2005 01:55:17 PM |
| List: | com.mysql.lists.mysql |
Hi,
If i understand :
select month(entryDate) as monthPart, if (amount is nul,'',day(entryDate) ) as dayPart, amount from raindata order by dayPart, monthPart
Best Regards
-------------------- Mathias FATENE
Hope that helps *This not an official mysql support answer
-----Original Message----- From: jabb...@abbotts.org [mailto:jabb...@abbotts.org] Sent: mercredi 27 avril 2005 22:24 To: mys...@lists.mysql.com Subject: query question
I have a table that the important parts look something like: keynum int, entryDate datetime, amount varchar(10)
What I want to do is a query that gets me every day of the year and just has null values for the days that don't have anything in the amount column. Is something like that possible with sql? In fact, what I would really like is:
select month(entryDate) as monthPart, day(entryDate) as dayPart, amount from raindata order by dayPart, monthPart
just with the whole year filled in. it will make my later code simplier if I can not have to test for values as much.
--ja
--
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=mfat...@free.fr




