hi,
i have a query like this:
select id from jointbs where1
union
select id from jointbs where2 and id not in (select id from jointbs where1)
is it any good way to handle this case? thanks...select id ... where1
union all
select id ... where2
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"js" <js@.someone.com> wrote in message
news:OpfdFXVRFHA.2348@.tk2msftngp13.phx.gbl...
> hi,
> i have a query like this:
> select id from jointbs where1
> union
> select id from jointbs where2 and id not in (select id from jointbs
> where1)
> is it any good way to handle this case? thanks...
>
>|||Sorry, late night fritz, I was thinking the opposite.
Can you please give better specs. See my sig for more info.
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.|||Thanks Aaron,
how about this:
do I have to use the "not in" clause?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uBXqUnVRFHA.244@.TK2MSFTNGP12.phx.gbl...
> select id ... where1
> union all
> select id ... where2
> --
> This is my signature. It is a general reminder.
> Please post DDL, sample data and desired results.
> See http://www.aspfaq.com/5006 for info.
>
>
> "js" <js@.someone.com> wrote in message
> news:OpfdFXVRFHA.2348@.tk2msftngp13.phx.gbl...
>|||PLEASE post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment