How to Shows output this

Posted by Jayakumars under Sql Server on 8/3/2018 | Points: 10 | Views : 2956 | Status : [Member] [MVP] | Replies : 2
Hi

How to Shows Single Records particular Table

create table EmailTesting
(
id int primary key identity(1,1),
emailid nvarchar(100),
Date datetime
)


Insert into EmailTesting VALUES('abc@gmail.com',GETDATE()+1)
Insert into EmailTesting VALUES('abce@gmail.com',GETDATE()+2)
Insert into EmailTesting VALUES('abct@gmail.com',GETDATE()+3)
Insert into EmailTesting VALUES('abc@gmail.com',GETDATE()+4)
Insert into EmailTesting VALUES('abc@gmail.com',GETDATE()+5)



select * from EmailTesting

--I need output
-- How to Show Without Duplicate Emailid only shows

--ID EmailID Date
--2 abce@gmail.com 2018-08-05 13:04:17.720
--3 abct@gmail.com 2018-08-06 13:04:17.720

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

Posted by: Sriharim on: 8/5/2018 [Member] Starter | Points: 25

Up
0
Down

select * from EmailTesting where emailid in (select emailid from EmailTesting group by emailid having count(*)=1)


Mark as Answer if its helpful to you
---
Srihari

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Annaeverson on: 8/7/2018 [Member] Starter | Points: 25

Up
0
Down
nice article

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response