Brett Mc Bride <brett(dot)mcbride(at)deakin(dot)edu(dot)au> wrote:
> How about:
> SELECT * from (
> SELECT somecolumns
> FROM ko
> LEFT JOIN t1 ON t1.primarykey= ko.t1foreignkwey
> ...
> LEFT JOIN tn ON tn.primarykey= ko.tnforeignkwey
> WHERE ko.primarykey='someprimarykeyvalue'
> UNION ALL
> SELECT default_value
> )
> LIMIT 1;
> [...]
... with a proper "ORDER BY" clause.
Tim