Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-06 09:40:13
Original
1430 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!