数据库复杂查询

1。内连接结合左连接
首先是数据库表a和数据库表b的内连接,然后是数据库表a与数据库表c的左连接。
on和where后面跟随的都是条件

select * from
a inner join b on 条件 where ...
left join c on 条件 where ...



2、列出一张表同一字段出现大于等于2次的列,sql怎么表达

select t.vcexpressinvoicecode,count(t.vcexpressinvoicecode) from tbexpressinvoice t
group by  t.vcexpressinvoicecode
having count(t.vcexpressinvoicecode)>2;

你可能感兴趣的:(java,sql,C++,c,C#)