Subquery help

  • Thread starter Thread starter R
  • Start date Start date
R

R

Hi,

I have a table that lists values grouped under several
headings.

There is a master list of values (not associated with
headings) in a separate table.

I need to show each heading along with all values in the
master list NOT under that heading.

Do I need a subquery (simple or correlated)?

Thanks,
R
 
Hi,


The "heading" (or column name) is not data accessible through SQL. We
can say that if you need to handle those name, then your table is not
designed for the tool you have in your hand (like a copper pipe is not
designed to hammer nails in a wall), or that your table is not "normalized".


Rather than

Id January February March
1010 10 12 13
1011 10 22 23


try

Id Month Value
1010 January 10
1010 February 12
1010 March 13
1011 January 20
1011 February 22
1011 March 23



And then, you can make tests like:

WHERE Month='March'

to get only the records implying March.

You can use a Crosstab to un-normalize the normal design into a format
agreeable for human consultation (but horrible for work), such as is the
initial not normalized table design.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top