Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multiple WHERE select possible?

0 views
Skip to first unread message

la...@portcommodore.com

unread,
Jul 22, 2008, 2:47:43 PM7/22/08
to
Ok I want to select two things from a complex table query, one WHERE
is exclusionary of the other but I would like the combined result set.

i.e.:
I want to select a list of all the records once
plus any records (in the same data set) with an unpaid-date before
today.

so some of them may have two records but all have at least one.

can I do some sort of WHERE clause twice and get the set or do I have
to do all the joins twice via UNION for the same data repeated.

Suggestions are appreciated.

Peter H. Coffin

unread,
Jul 22, 2008, 3:08:05 PM7/22/08
to

Would an OR clause screw up your WHERE?

--
16 megs in a '95 box! Yo Ho Ho and a battle of RAM!

la...@portcommodore.com

unread,
Jul 22, 2008, 3:29:22 PM7/22/08
to
On Jul 22, 12:08 pm, "Peter H. Coffin" <hell...@ninehells.com> wrote:

>
> Would an OR clause screw up your WHERE?
>

I tried using OR, but I don't get two selects of the same record. only
singles

toby

unread,
Jul 22, 2008, 5:08:50 PM7/22/08
to

Sounds like you need UNION ALL, or perhaps do one select, but
including an extra calculated field that 'flags' each unpaid record?

la...@portcommodore.com

unread,
Jul 22, 2008, 6:05:51 PM7/22/08
to
On Jul 22, 2:08 pm, toby <t...@telegraphics.com.au> wrote:
>
> Sounds like you need UNION ALL, or perhaps do one select, but
> including an extra calculated field that 'flags' each unpaid record?

UNION ALL sounds like the best way to go.

Thanks

0 new messages