How to retrieve name who having two different email_id in the table?

Reply

Join Date: Aug 2008
Posts: 22
Reputation: dharam_05 is an unknown quantity at this point 
Solved Threads: 0
dharam_05 dharam_05 is offline Offline
Newbie Poster

How to retrieve name who having two different email_id in the table?

 
0
  #1
Aug 22nd, 2008
Hi,
I just want to retrieve name of the employees who have two or more than two email_id in employee table. pls help me out..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: How to retrieve name who having two different email_id in the table?

 
0
  #2
Aug 22nd, 2008
select * from employees
group by employee_id
having count(employee_id) >= 2
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 79
Reputation: varmadba is an unknown quantity at this point 
Solved Threads: 8
varmadba varmadba is offline Offline
Junior Poster in Training

Re: How to retrieve name who having two different email_id in the table?

 
0
  #3
Aug 22nd, 2008
your question is not clear

How are emails stored in table?
do you have separate columns to save each email ids
or they are saved in 1 columns

if email ids are saved in separate columns
then try

  1. SELECT * FROM table1 WHERE
  2. (email_column1 IS NOT NULL AND (email_column2 IS NOT NULL OR email_column3 IS NOT NULL .....)

if email ids are saved in single column
then try

  1. SELECT * FROM table1
  2. WHERE email_column1 LIKE '%@%@%@%.........
  3.  
:- Varma

We are Happy to inform launch of a new site with loads of database related information Site offers wide range of functionality Forums,Blogs,Articles,Editorials and much more
http://www.sqllibrarian.info/
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC