V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
git00ll
V2EX  ›  MySQL

mysql distinct 多列情况下,得到的结果是相当于将多列拼接在一起去重吗

  •  
  •   git00ll · 2021-12-30 14:35:42 +08:00 · 1305 次点击
    这是一个创建于 819 天前的主题,其中的信息可能已经有所发展或是发生改变。

    是不是 约等于将选中的多列按照字符串拼接后去重. 不太理解 distinct 多列背后的逻辑

    2 条回复    2021-12-30 14:51:51 +08:00
    zydxn
        1
    zydxn  
       2021-12-30 14:42:10 +08:00   ❤️ 1
    In most cases, a DISTINCT clause can be considered as a special case of GROUP BY.

    https://dev.mysql.com/doc/refman/8.0/en/distinct-optimization.html
    breadenglish
        2
    breadenglish  
       2021-12-30 14:51:51 +08:00   ❤️ 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5493 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 08:22 · PVG 16:22 · LAX 01:22 · JFK 04:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.