简体   繁体   English

计数一个串联的字段

[英]Count a concatenated field

The following query is an attempt to find multiple occurrences of a concatenated field: 以下查询是尝试查找串联字段的多次出现:

SELECT ID, NUM1, NUM2, CONCAT(NUM1, NUM2)
FROM TABLE
GROUP BY ID, NUM1, NUM2, CONCAT(NUM1, NUM2)
HAVING COUNT(CONCAT(NUM1, NUM2) > 1

I am currently getting a list of records with COUNT(NUM1) > 1. How can I successfully query the count of a concatenated field? 我目前正在获得COUNT(NUM1)> 1的记录列表。如何成功查询串联字段的计数?

I ended up creating two instances of TABLE, linked by NUM1 and NUM2 separately, and inserted a ID_A != ID_B row. 我最终创建了两个TABLE实例,分别由NUM1和NUM2链接,并插入了ID_A!= ID_B行。 Not quite what I was looking for, but it works. 并不是我要找的东西,但是它可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM