mysql和区分大小写真的令人困惑

时间:2018-02-21 16:34:03

标签: mysql

Windows操作系统 - phpMyAdmin

select auth, COUNT(*) AS count from posts where auth = 1;

提供信息:

Your SQL query has been executed successfully

但:

select auth, count(*) AS count from posts where auth = 1;

给出以下内容:

Showing rows 0 - 0 (1 total, Query took 0.0070 seconds.

here我发现了一个关于MySql和区分大小写的真实令人困惑的故事。

关于编写查询,有关大写或大写的常见最佳实践,还是我必须为每个操作系统单独学习所有规则?

1 个答案:

答案 0 :(得分:0)

你试过了吗?

 select auth, count(*) AS count 
 from posts 
 where auth = 1
 group by auth
 ;