使用concat而不是||时为什么会出错?在下面的查询

时间:2019-03-05 05:48:17

标签: sql

SELECT 'THERE ARE A TOTAL OF '||COUNT(*) ||' '|| OCCUPATION
FROM OCCUPATIONS
GROUP BY OCCUPATION
ORDER BY COUNT(*) ASC, OCCUPATION ASC;

我用过

SELECT CONCAT('THERE ARE A TOTAL OF ', CONCAT(COUNT(*), OCCUPATION))

2 个答案:

答案 0 :(得分:0)

尝试如下

SELECT concat('THERE ARE A TOTAL OF ',COUNT(*) ,' ',OCCUPATION)
FROM OCCUPATIONS
GROUP BY OCCUPATION
ORDER BY COUNT(*) ASC, OCCUPATION ASC  

答案 1 :(得分:0)

请尝试这个。

git ls-remote -h /path/to/git/repo