Re: Question on create view
Posted in 1996
* > Can I create a view on a column which is define as either date or =
* datetime
* > and retrieving only the latest row of data ?
* >=20
* > Example:
* > 100 10/25/93
* > 100 02/05/95
* > 200 08/09/96
* >=20
* > I want my view to display only the second and third row.
* >=20
*
* Dominic,
*
* Yes... I think :-)
*
* create view view_name as
* select col1, max(date_col) from table_name;
*
* Check out the "Informix Guide to SQL - Syntax" manual for more details. =
* It
* doesn't say you CAN'T do this !!
I've tested this and it works fine. You will need to do it as such:
CREATE VIEW VIEW_NAME(col1, dt_col) AS
SELECT col1, MAX(date_col) FROM table_name
GROUP BY col1;
Robert Minter Data Systems Support \\\\\\_///
Senior Software Engineer A Client Technologies Company ( _ _ )
E-Mail: rob@dssmktg.com Tel: 714.771.0454 (| ^ |)
#include <disclaimer.h> Fax: 714.771.3028 \\`-'/
De Colores - Emmaus OC-13 SURF'S UP \\_/