List:General Discussion« Previous MessageNext Message »
From:Kelly Yancey Date:April 22 1999 3:34pm
Subject:Question: how to count unique rows in multiple tables?
View as plain text  
  I've run into a deceptively simple problem: I have 2 tables each which
are associated with a 3rd table via an ID field, I need to count the
number of rows with unique ID values in both of the 2 tables. For example:

  Master Table
  ID	Name
  --------------------------
  0	Example
  1	Another example
  2	One more example
  3	Final example

  Table A
  ID	Data
  -------------------------
  0	Some associated data
  0	Another piece of data
  3	Yet more data

  Table B
  ID	OtherData
  ------------------------
  0	Stuff
  1	More Stuff
  1	Even More Stuff

  What I would be looking for is the number of rows with unique ID values
between Table A and Table B (so the answer should be 3: (IDs 0, 1, and 3))
How would I do this with a SQL query?
  
  I really appreciate the help!

  Kelly

 ~kbyanc@stripped~
 "Silly penguin, Linux is for kids"



Thread
Question: how to count unique rows in multiple tables?Kelly Yancey22 Apr
Re: Question: how to count unique rows in multiple tables?Tomislav Petrovic23 Apr
  • Problem executing query, a bug perhaps?A. Brandic26 Apr
    • Re: Problem executing query, a bug perhaps?Jules Bean26 Apr
      • Re: Problem executing query, a bug perhaps?A. Brandic26 Apr
      • Re: Problem executing query, a bug perhaps?A. Brandic26 Apr
        • Re: Problem executing query, a bug perhaps?Jules Bean26 Apr
    • Re: Problem executing query, a bug perhaps?Sasha Pachev26 Apr