On 22-01-11 00:53, Josh Gibbs wrote:
> Could someone please clarify for me if the the resulting order of a UNION
> query will come back with the left data first, then the right data in 
> the case
> that no ordering has been defined for the query.
>
> My need is to have a parameter stored in a database, with an optional
> overriding parameter which should take precedence, such as:
>
> select value from param_overrides where key='setting' UNION
> select value from params where key='setting'
>
> I'd like the resulting recordset to always contain the override parameter
> first if it exists so I can simply use that value.
>
> Thanks, Josh
>
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

select value, 1 as myorder from param_overrides where key='setting' UNION
select value, 2 as myorder from params where key='setting'
order by 2;



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to