Solved

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

Posted on 2016-09-15
1
26 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now