Solved

trying to get the non-distinct values to show in a result set

Posted on 2016-09-15
1
37 Views
Last Modified: 2016-10-15
I know in a data set that I have two values (title shrpe) equal in value (16) to each other because I ran the following:

SELECT COUNT(shrpe) FROM shr;  /* this gives 10

SELECT COUNT(DISTINCT shrpe)AS 'Different PEs'  FROM shr;  /* this gives 8


Now, how do I get the 2 shrpe values that are the same to show in a result set? What's the query structure for that?
0
Comment
Question by:chonabraham
1 Comment
 
LVL 40

Accepted Solution

by:
Sharath earned 500 total points
ID: 41800445
This displays the duplicated values.
SELECT shrpe FROM shr GROUP BY shrpe HAVING COUNT(*) > 1

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
phpMyAdmin simple sql statement 3 59
MYSQL simple update statement 3 54
showing numeric numbers 2 36
Display images from mysql blob type (Not working) 9 30
Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question