Redian新闻
>
help!!! who's familiar with mysql command
avatar
help!!! who's familiar with mysql command# Database - 数据库
t*g
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
avatar
w*r
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。