|< 1 2 >| | 16 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
CREATE TABLE component_history (
component_id integer NOT NULL,
history_timestamp timestamp without time zone DEFAULT '2005-12-29 16:46:13.763751'::timestamp without time zone NOT NULL,
name character varying NOT NULL,
fqdn character varying NOT NULL,
state character varying(10) DEFAULT 'active'::character varying NOT NULL,
is_byhand boolean DEFAULT false NOT NULL,
is_measured boolean DEFAULT true NOT NULL
);
SELECT* FROM component_history ORDER BY history_timestamp
1
2
3
4
103 | 2004-09-23 00:00:00 | component01 | component01 | active | f | t
103 | 2006-04-01 00:00:00 | component01 | component01 | inactive | f | t
104 | 2004-09-23 00:00:00 | component02 | component02 | active | f | t
104 | 2006-04-01 00:00:00 | component02 | component02 | inactive | f | t
1
2
103 | 2006-04-01 00:00:00 | component01 | component01 | inactive | f | t
104 | 2006-04-01 00:00:00 | component02 | component02 | inactive | f | t
SELECT LIMIT 2 * FROM component_history ORDER BY history_timestamp (LIMIT 2 )
1
2
3
4
SELECT * FROM component_history WHERE ID =
(
SELECT DISTINCT LIMIT 1 ID FROM component_history ORDER BY history_timestamp WHERE ID=component_history.ID
)
|< 1 2 >| | 16 Einträge, 2 Seiten |