Home  >  Article  >  Database  >  mysql数据库,在查询列名里子查询一列由两列组合去重的个数如何实现?

mysql数据库,在查询列名里子查询一列由两列组合去重的个数如何实现?

WBOY
WBOYOriginal
2016-06-06 09:40:131428browse

mysqlsql数据库

需求:数据库有:列1----列2----
127.0.0.1-----123-----
127.0.0.1-----123-----
127.0.0.1-----123-----
124.254.42.38----541---
去除重复后结果
127.0.0.1---123
124.254.42.38----541
然后如何获得个数。

自己想了一下写出来后有错
select
( select
DISTINCT 列1,列2
FROM
table
),count(*)
FROM
table

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn