zoukankan      html  css  js  c++  java
  • SQL Server select count(distinct *)

    测试表:student

    select * from studnet;

    image

    select count(distinct name) from student;
    image
    select count(distinct *) from student;

    image

    这样是有错误的,可以变通的实现
    select count(*) 
    from
    (select distinct * from student) st;

    image

    此路不通,我走另一条路!

  • 相关阅读:
    为什么会决定进行分库分表,分库分表过程中遇到什么难题,如何解决的?
    MySQL主从复制什么原因会造成不一致,如何预防及解决?
    PyQt5(2)、垃圾分类小程序(2)——初代窗口程序可执行文件
    垃圾分类小程序(1)——实现查找垃圾的类别
    python上的数据库sqlite3——插入多行数据
    pandas.DataFrame——pd数据框的简单认识、存csv文件
    Beautiful Soup 4.2.0 doc_tag、Name、Attributes、多值属性
    第一个爬虫——豆瓣新书信息爬取
    Decorator——Python初级函数装饰器
    正则表达式——字符类、分支条件、分组
  • 原文地址:https://www.cnblogs.com/cnmarkao/p/4157961.html
Copyright © 2011-2022 走看看