Jan Urba??ski wrote:
>Preference SQL is an extension to regular SQL, that allows expressing
>preferences in SQL queries. Preferences are like "soft" WHERE clauses. A
>preference doesn't need to be satisfied by a tuple for it to appear in
>the result set, but it's "preferred" it is. More strictly, a set of
>preference clauses in a SQL query defines a partial order on the result
>set as it would appear without any preference clauses and then returns
>the maximal elements.
>An example of a preference query would be (quoting the linked PDF):
>SELECT * FROM programmers PREFERRING exp IN (???java???, ???C++???);
>or
>SELECT * FROM computers
>PREFERRING HIGHEST(main_memory) AND HIGHEST(cpu_speed);
Forgive my ignorance, but it appears that this can already be achieved
by using a properly weighted ORDER BY clause, as in:
SELECT * FROM computers
ORDER BY HIGHEST(main_memory) DESC, HIGHEST(cpu_speed) DESC;
--
Sincerely, srb@cuci.nl Stephen R. van den Berg.
"Sleep: A completely inadequate substitute for caffeine."