MySQL Forums
Forum List  »  InnoDB

selet sql statement
Posted by: gabriel ang
Date: July 06, 2005 09:13AM

+--------+--------------------+----------+---------------------+
| param1 | chartdata | selected | period |
+--------+--------------------+----------+---------------------+
| TDK | 0.0433367633706602 | 7 | 2004-03-01 00:00:00 |
| TDK | 0.0422521842674081 | 7 | 2004-05-01 00:00:00 |
| TDK | 0.0365584897586015 | 7 | 2004-06-01 00:00:00 |
| TDK | 0.0390748917114817 | 7 | 2004-07-01 00:00:00 |
| TDK | 0.0391893992445888 | 7 | 2004-08-01 00:00:00 |
| TDK | 0.0365909840634278 | 7 | 2004-09-01 00:00:00 |
| TDK | 0.0429593246956021 | 7 | 2004-10-01 00:00:00 |
| TDK | 0.0328605623990276 | 7 | 2004-11-01 00:00:00 |
| TDK | 0.045986832774676 | 7 | 2004-12-01 00:00:00 |
| TDK | 0.0449210471010234 | 7 | 2005-01-01 00:00:00 |
| TDK | 0.0449210475093775 | 7 | 2005-02-01 00:00:00 |
| TDK | 0.0449210460978193 | 7 | 2005-03-01 00:00:00 |
+--------+--------------------+----------+---------------------+

i got a table which is like above .. i want a null value with the period '2004-04-01' as it is not inside the table ...using only the select statement to select this table but i dun wan to insert the null value inside ..i just wanna use select statement to show it out ... any ideas on how to do it ? pls help ...

eg
select * from table;

+--------+--------------------+----------+---------------------+
| param1 | chartdata | selected | period |
+--------+--------------------+----------+---------------------+
| TDK | 0.0433367633706602 | 7 | 2004-03-01 00:00:00 |
TDK null null 2004-04-01 00:00:00
| TDK | 0.0422521842674081 | 7 | 2004-05-01 00:00:00 |
| TDK | 0.0365584897586015 | 7 | 2004-06-01 00:00:00 |
| TDK | 0.0390748917114817 | 7 | 2004-07-01 00:00:00 |
| TDK | 0.0391893992445888 | 7 | 2004-08-01 00:00:00 |
| TDK | 0.0365909840634278 | 7 | 2004-09-01 00:00:00 |
| TDK | 0.0429593246956021 | 7 | 2004-10-01 00:00:00 |
| TDK | 0.0328605623990276 | 7 | 2004-11-01 00:00:00 |
| TDK | 0.045986832774676 | 7 | 2004-12-01 00:00:00 |
| TDK | 0.0449210471010234 | 7 | 2005-01-01 00:00:00 |
| TDK | 0.0449210475093775 | 7 | 2005-02-01 00:00:00 |
| TDK | 0.0449210460978193 | 7 | 2005-03-01 00:00:00 |
+--------+--------------------+----------+---------------------+




Edited 2 time(s). Last edit at 07/07/2005 09:45AM by gabriel ang.

Options: ReplyQuote


Subject
Views
Written By
Posted
selet sql statement
3196
July 06, 2005 09:13AM
1921
July 06, 2005 07:43PM
1985
July 07, 2005 11:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.