2011/6/25 Max Vlasov <[email protected]>
> Use ORDER BY ... DESC. Sure, if you have a large dataset, it'd better be
> indexed.
>
At the moment it is not a large dataset, but it is better to be prepared. I
have the following definition:
CREATE TABLE IF NOT EXISTS weights (
id INTEGER PRIMARY KEY,
categoryID INTEGER NOT NULL,
measureDate DATE DEFAULT (DATE('now')),
weight FLOAT NOT NULL,
fat FLOAT,
water FLOAT,
muscle FLOAT,
UNIQUE (
categoryID,
measureDate
)
);
The select is on the categoryID and measureDate. The UNIQUE constraint is
good enough, or is there needed more?
--
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users