Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-09-15
1
Medium Priority
?
44 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
Sharath earned 2000 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

722 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