首页 > 数据库 > MySQL > 正文

MySQL子查询

2024-07-24 12:32:29
字体:
来源:转载
供稿:网友
        SELECT
 
        SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(do,'B',''),'.','0'),'_','1'),'-','1'),1,32),B.id,B.du,B.phone,B.createdate,
 
        B.modifydate FROM ca.pro  AS B
 
        WHERE SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(do,'B',''),'.','0'),'_','1'),'-','1'),1,32) IN
 
        (SELECT A.do1 FROM
 
(SELECT SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(do,'B',''),'.','0'),'_','1'),'-','1'),1,32) AS do1,COUNT(*) AS count1 FROM ca.pro
 
GROUP BY SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(do,'B',''),'.','0'),'_','1'),'-','1'),1,32)
 
HAVING COUNT(*) >1) AS A)

(编辑:武林网)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表