8 messages in com.mysql.lists.mysqlRe: Question: how to count unique row...| From | Sent On | Attachments |
|---|---|---|
| Kelly Yancey | 22 Apr 1999 08:34 | |
| Tomislav Petrovic | 23 Apr 1999 02:04 | |
| A. Brandic | 26 Apr 1999 04:12 | |
| Jules Bean | 26 Apr 1999 06:05 | |
| A. Brandic | 26 Apr 1999 06:19 | |
| A. Brandic | 26 Apr 1999 06:36 | |
| Jules Bean | 26 Apr 1999 06:57 | |
| Sasha Pachev | 26 Apr 1999 07:49 |
| Subject: | Re: Question: how to count unique rows in multiple tables?![]() |
|---|---|
| From: | Tomislav Petrovic (t.pe...@computer.org) |
| Date: | 04/23/1999 02:04:39 AM |
| List: | com.mysql.lists.mysql |
Haven't checked this, so.........
SELECT COUNT(DISTINCT(master.id)) FROM master, a, b WHERE master.id=a.id OR master.id=b.id;
Tomy.
-----Original Message----- From: Kelly Yancey <kby...@alcnet.com> To: mys...@lists.mysql.com <mys...@lists.mysql.com> Date: èetvrtak, travanj 22, 1999 17:23 Subject: Question: how to count unique rows in multiple tables?
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
~kby...@alcnet.com~ "Silly penguin, Linux is for kids"
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail mysq...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail mysq...@lists.mysql.com instead.




