I'm using 5.0.9 beta standard. I'll try to upgrade and will re-post if I
still get erroneous results.
s.m.
Am Mon, 15 Aug 2005 18:53:40 +0200 hat Gleb Paharenko
<[EMAIL PROTECTED]> geschrieben:
Hello.
What version of MySQL do you use? On my 5.0.11 I have a correct result:
mysql> show create table dateTest\G;
*************************** 1. row ***************************
View: dateTest
Create View: CREATE ALGORITHM=UNDEFINED VIEW
`test`.`dateTest` AS
select sql_no_cache `test`.`tDay`.`theDate` AS
`theDate`,`test`.`tDay`.`a` AS `a` from `test`.`tDay`
where
(`test`.`tDay`.`theDate` > (now() - interval 1 day))
[EMAIL PROTECTED] wrote:
I have a table with date values:
+------------+
| theDate |
+------------+
| 2005-08-15 |
| 2005-08-16 |
| 2005-08-14 |
+------------+
I can execute this select statement on it:
select * from tDay where theDate > date_sub( now(), interval 1 day);
And I can create a view from it:
create view dateTest as select * from tDay where theDate >
date_sub( now(), interval 1 day);
On creating the view, the date_sub function is replaced by its result,
though, so that the view does not generate dynamic results:
show create table dateTest;
CREATE ALGORITHM=UNDEFINED VIEW `kurse`.`dateTest` AS select
sql_no_cache `kurse`.`tDay`.`theDate` AS `theDate` from
`kurse`.`tDay` where (`kurse`.`tDay`.`theDate` > 20050814)
How can I avoid this replacement and make this view a truly dynamic one?
s.m.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]