Kumar AU

Kumar AU

  • 1.4k
  • 309
  • 62k

Need Help on Sql Query - how to get the recently deleted rec

Jun 27 2016 3:15 AM
Dear All,
Please help me I am new to SQL
Could you please let me know how to get the recently deleted records from the below Table. Here I need to make a query only on rows which has more than 1 rows for the same Number column
I need Result like this :-
ID       FName       LName            Number              CreateDate
2         BBBBB         B                  111111              06-26-2016 01:18:000
3        CCCCC         C                   333333             06-25-2016 06:10:000
Create Table Users1
(
ID int,
FName varchar (50),
LName Varchar (50),
Number varchar(10),
CreateDate Datetime
)
INSERT INTO Users1 Values (1,'AAAA','A','11111','06-25-2016 00:10:765')
INSERT INTO Users1 Values (2,'BBBB','B','11111','06-26-2016 01:18:000')
INSERT INTO Users1 Values (3,'CCCC','C','33333','06-25-2016 06:10:000')
INSERT INTO Users1 Values (4,'DDDD','D','44444','06-25-2016 06:10:000')
INSERT INTO Users1 Values (5,'EEEE','E','55555','06-25-2016 23:10:000')
INSERT INTO Users1 Values (6,'FFFF','F','33333','06-25-2016 00:01:000')
INSERT INTO Users1 Values (7,'FFFF','G','77777','06-26-2016 00:01:000')
INSERT INTO Users1 Values (8,'FFFF','H','88888','06-26-2016 16:01:000')
INSERT INTO Users1 Values (9,'FFFF','F','99999','06-26-2016 23:01:000')

Answers (5)