gpt4 book ai didi

mysql - LIMIT 在我的查询中不起作用

转载 作者:行者123 更新时间:2023-11-29 01:09:45 25 4
gpt4 key购买 nike

我有以下 MySQL 查询:

SELECT 
( SELECT count( city) as no_off_total_cityies FROM station )
- ( SELECT count(DISTINCT city) as no_off_total_cityies FROM station ) AS sub_value
FROM station

工作正常,但是当我在查询中添加 LIMIT 1 时它不工作

SELECT 
( SELECT count( city) as no_off_total_cityies FROM station )
- ( SELECT count(DISTINCT city) as no_off_total_cityies FROM station ) AS sub_value
FROM station LIMIT 1

最佳答案

试试这个查询:-

SELECT (count(city) - count(DISTINCT city)) sub_value from station 

关于mysql - LIMIT 在我的查询中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38582557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com