Skip to content

[mysql]常用语句 #66

@mic101

Description

@mic101

select * from company_list_all left join qyxy_company_list on (company_list_all.name=qyxy_company_list.name) where qyxy_company_list.name is null
左连接查A中不存在于B中的数据

select * ,COUNT()from company_list_all GROUP BY name HAVING COUNT() >1
查询表中重复的数据

insert into qyxy_company_list (name)
select company_list_all.name from company_list_all left join qyxy_company_list on (company_list_all.name=qyxy_company_list.name) where qyxy_company_list.name is null
把一个表的数据导入另一个表

update qyxy_company_list set srcfrom='人工' where srcfrom is null
更新字段内容

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions