t*******g 发帖数: 286 | 1 I have 2 sets of data that stored in mysql as table A and B. both have 2
field : GI(primary key) and Function in the table. I tried the command:
Select A.GI from A,B where A.GI=B.GI; and got the
data that has A and B in common.
but How could I compare this 2 tables and get the data that just included in
A but not in B? the command: Select A.GI from A,B where A.GI != B.GI; didn'
t work.
please help me out! thanks | w*r 发帖数: 2421 | 2 select a.gi, b.gi
from a left join b on (a.gi = b.gi)
where b.gi is null;
in
didn'
【在 t*******g 的大作中提到】 : I have 2 sets of data that stored in mysql as table A and B. both have 2 : field : GI(primary key) and Function in the table. I tried the command: : Select A.GI from A,B where A.GI=B.GI; and got the : data that has A and B in common. : but How could I compare this 2 tables and get the data that just included in : A but not in B? the command: Select A.GI from A,B where A.GI != B.GI; didn' : t work. : please help me out! thanks
|
|