查询以找到coloumn中重复值的no [英] Query to find the no of repeated values in a coloumn

查看:67
本文介绍了查询以找到coloumn中重复值的no的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL表中有一个这样的列

供应商ID 
1
1
2
1
3
2
2
3
1
3
如何在此处重复查找供应商ID值,

例如:这里1重复4次,我需要所有数字

任何1都有助于编写此查询

解决方案

您在寻找这个吗?

选择SUPPLIERID,按SUPPLIERID从Mytable组中计算(*)





谢谢

--RA


这样的东西:

  SELECT  
类别,
COUNT(*) AS `num`
FROM
发布
GROUP BY


I had a column in SQL Table like this

      SUPPLIER ID
          1
          1
          2
          1
          3
          2
          2
          3
          1
          3
How to find the SUPPLIER ID values no of times repeated here, 

for eg:  here 1 repeated for 4 times like wise i need for all the numbers 

can any 1 helps to write this query

解决方案

Are you looking for this?

select SUPPLIERID,count(*) from Mytable group by SUPPLIERID



Thanks
--RA


Something like this:

SELECT
  category,
  COUNT(*) AS `num`
FROM
  posts
GROUP BY
  category


这篇关于查询以找到coloumn中重复值的no的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆