MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 18th, 2004, 08:48 AM
raphlo raphlo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Montréal, Québec
Posts: 25 raphlo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 14 m 15 sec
Reputation Power: 0
Send a message via MSN to raphlo
Unhappy Basic SQL query logic

Hi,
I need some help on a basic SQL query. I have a table which contains emails addresses.
I' like to retrieve all the emails that are repeat twice or more.

Here's the SELECT statement for that table :
SELECT
CRIMULTI_email.strID AS strID,
CRIMULTI_email.email AS Email
FROM
CRIMULTI_email

I know it's possible to make the query in a single select statement !!! But HOW !!!!

Thank you in advanced !

Reply With Quote
  #2  
Old May 18th, 2004, 09:09 AM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,766 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 6 h 24 m 8 sec
Reputation Power: 37
Code:
SELECT
email 
FROM
CRIMULTI_email
group by email
having count(*) >= 2

Reply With Quote
  #3  
Old May 18th, 2004, 09:24 AM
raphlo raphlo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Montréal, Québec
Posts: 25 raphlo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 14 m 15 sec
Reputation Power: 0
Send a message via MSN to raphlo
Thank you very much !

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Basic SQL query logic


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway