C
cjg.groups
Hello, can I have a single WHERE clause and ORDER BY clause in a UNION
query? I could put a WHERE and ORDER BY after each of the SELECTs,
but that's messy.
I'm cleaning some poorly designed tables which stored four identical
groups of fields in each record. UNION ALL is used to make this one
group of fields with four times as many records.
Much of these records are blank, so I would like single "WHERE name IS
NOT NULL". UNION can't filter all of these as duplicate because of
some qualifiers, and UNION ALL is faster.
Also, I've used AS to rename the fields in the first SELECT statement,
since each group of four fields had slightly different names. Can I
use a WHERE and ORDER BY on those renamed field?
Thanks!!
query? I could put a WHERE and ORDER BY after each of the SELECTs,
but that's messy.
I'm cleaning some poorly designed tables which stored four identical
groups of fields in each record. UNION ALL is used to make this one
group of fields with four times as many records.
Much of these records are blank, so I would like single "WHERE name IS
NOT NULL". UNION can't filter all of these as duplicate because of
some qualifiers, and UNION ALL is faster.
Also, I've used AS to rename the fields in the first SELECT statement,
since each group of four fields had slightly different names. Can I
use a WHERE and ORDER BY on those renamed field?
Thanks!!