有表ecc_individual里有customer_id,name,id_num,home_phone,phone,email想取有相同 1) first, the customer has identical ID #; 2) then, the customer unqualified for 1), but has identical 姓名和地址; 3) then, the customer unqualified for 1)+2), but has identical 姓名和座机 4) then, the customer unqualified for 1)+2)+3), but has identical姓名和手机号码 5) then, the customer unqualified for 1)+2)+3)+4) but has identical姓名和email
在一个表里取相同的一个或俩个字段该怎么做呢
select distinct a.* from ecc_individual a,ecc_individual b where a.name = b.name and a.id_num = b.id_num and a.rowid <> b.rowid
a.rowid是指什么呢, 有表ecc_individual里有customer_id,name,id_num,home_phone,phone,email想取有相同 1) first, the customer has identical ID #; 2) then, the customer unqualified for 1), but has identical 姓名和地址; 3) then, the customer unqualified for 1)+2), but has identical 姓名和座机 4) then, the customer unqualified for 1)+2)+3), but has identical姓名和手机号码 5) then, the customer unqualified for 1)+2)+3)+4) but has identical姓名和email 我主要想在一个表里实现这样的条件
按照我的理解 1)select distinct a.* from ecc_individual a,ecc_individual b where a.customer_id = b.customer_id and a.rowid = b.rowid 2)select distinct a.* from ecc_individual a,ecc_individual b where a.customer_id <> b.customer_id and a.name = b.name and a.id_num = b.id_num ... 不晓得对不对~
不是这样的,是想求这个表的客户数量, 1) first, the customer has identical ID #; 2) then, the customer unqualified for 1), but has identical 姓名和地址; 3) then, the customer unqualified for 1)+2), but has identical 姓名和座机 4) then, the customer unqualified for 1)+2)+3), but has identical姓名和手机号码 5) then, the customer unqualified for 1)+2)+3)+4) but has identical姓名和email 按这样的如果id_num一样的话,剩下的按name和address,..... 求客户量
1) first, the customer has identical ID #;
2) then, the customer unqualified for 1), but has identical 姓名和地址;
3) then, the customer unqualified for 1)+2), but has identical 姓名和座机
4) then, the customer unqualified for 1)+2)+3), but has identical姓名和手机号码
5) then, the customer unqualified for 1)+2)+3)+4) but has identical姓名和email
在一个表里取相同的一个或俩个字段该怎么做呢
from ecc_individual a,ecc_individual b
where a.name = b.name and
a.id_num = b.id_num and
a.rowid <> b.rowid
有表ecc_individual里有customer_id,name,id_num,home_phone,phone,email想取有相同
1) first, the customer has identical ID #;
2) then, the customer unqualified for 1), but has identical 姓名和地址;
3) then, the customer unqualified for 1)+2), but has identical 姓名和座机
4) then, the customer unqualified for 1)+2)+3), but has identical姓名和手机号码
5) then, the customer unqualified for 1)+2)+3)+4) but has identical姓名和email
我主要想在一个表里实现这样的条件
1)select distinct a.*
from ecc_individual a,ecc_individual b
where a.customer_id = b.customer_id and
a.rowid = b.rowid
2)select distinct a.*
from ecc_individual a,ecc_individual b
where a.customer_id <> b.customer_id and
a.name = b.name and
a.id_num = b.id_num
...
不晓得对不对~
1) first, the customer has identical ID #;
2) then, the customer unqualified for 1), but has identical 姓名和地址;
3) then, the customer unqualified for 1)+2), but has identical 姓名和座机
4) then, the customer unqualified for 1)+2)+3), but has identical姓名和手机号码
5) then, the customer unqualified for 1)+2)+3)+4) but has identical姓名和email
按这样的如果id_num一样的话,剩下的按name和address,.....
求客户量