Hi all.
I need your help, this is my tables in db mysql:
do_tableA
ID NAME
1 KEVIN
2 LAURA
3 CINDY
4 ROBERT
do_tableB
ID NAME
1 HUMPREY
2 KEVIN
3 LAURA
4 MARGOT
5 CINDY
6 LAUREN
7 ROBERT
8 FREDDIE
I need this output:
1 HUMPREY
4 MARGOT
6 LAUREN
8 FREDDIE
Any help would be very much appreciated and many thanks to any who can help me.
Thanks in advance.
Chevy
Really thanks for your suggestion.
You understand my problem:
SELECT * FROM do_tableB AS o
LEFT JOIN do_tableA AS c ON c.NAME = o.NAME
WHERE c.NAME IS NULL
ORDER BY ID ASC
For r937:
Learn to use the names do_tableA and do_tableB «copying» for your replies in this forum…
Bye
I guessed at everything in table B that wasn’t in table A.
But very poor description of the problem.
I’m with ya on that last post though, Hi Viki!
r937
July 19, 2010, 12:27am
4
nope
all i’m saying is that the sample data sucks
it is not at all clear what is required here
IBazz
July 19, 2010, 12:14am
5
You’ll need either to show other data that relate the data in the two tables or explain better what you are trying to do.
BTW, are you the same poster using a different name?
bazz
r937
July 19, 2010, 12:39am
6
the “do_table” schema belongs to our old friend viki1967
see
Hi. This is my query in db mysql: select substring_index(line,'-',1) as r, sum(if(dove=1,1,0)) as line_a, sum(if(dove=2,1,0)) as line_b, count(substring_index(line,'-',1)) as q from ( select line, 1 as dove from dotable_b union all select line_mt,...
A community for web designers and developers to discuss everything from HTML, CSS, JavaScript, PHP, to Photoshop, SEO and more.
considering all the trouble “viki” had with sql, i’m not surprised if she came back as a different member like “chevy”
r937
July 18, 2010, 11:13pm
7
how the heck does 1 KEVIN plus 1 HUMPREY produce 1 HUMPREY, and 4 ROBERT plus 4 MARGOT produce 4 MARGOT, but 3 CINDY plus 3 LAURA doesn’t produce anything???
the sample data sucks
So are you saying that it can’t be done?
do a left join, start with table B and check for nulls