List:General Discussion« Previous MessageNext Message »
From:mathias fatene Date:April 27 2005 8:55pm
Subject:RE: query question
View as plain text  
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: jabbott@stripped [mailto:jabbott@stripped] 
Sent: mercredi 27 avril 2005 22:24
To: mysql@stripped
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=1


Thread
query questionjabbott27 Apr
  • RE: query questionmathias fatene27 Apr
  • Re: query questionPeter Brawley27 Apr