- Mike first visit goes to ER on 1/1/2014 :- output this data
- Mike goes again to ER on 1/3/2014 :- output this data
- Mike goes to Clinic on 1/20/2014 :- do not output this data
- Mike goes to Clinic on 5/2/2014 : output this data
- David first visit goes to Clinic on 3/3/2014 : output this data
- David goes back again to Clinic on 3/4/2014 : do not output this data
- David goes to ER on 3/15/2014 : output this data
NAME LOCATION DATE
MIKE ER 1/1/2014
MIKE ER 1/3/2014
MIKE CLINIC 1/20/2014
MIKE CLINIC 5/2/2014
DAVID CLINIC 3/3/2014
DAVID CLINIC 3/4/2014
DAVID ER 3/15/2014
NAME LOCATION DATE
MIKE ER 1/1/2014
MIKE ER 1/3/2014
MIKE CLINIC 5/2/2014
DAVID CLINIC 3/3/2014
DAVID ER 3/15/2014
SET NOCOUNT ON
GO
DECLARE @Init_DataSource TABLE
(
[NAME] VARCHAR(20)
,[DATE] DATE
,[LOCATION] VARCHAR(15)
)
INSERT INTO @Init_DataSource ([NAME], [DATE], [LOCATION])
VALUES ('MIKE', '1-1-2014', 'ER')
,('MIKE', '1-3-2014', 'ER')
,('MIKE', '1-20-2014', 'CLINIC')
,('MIKE', '5-2-2014', 'CLINIC')
,('DAVID', '3-3-2014', 'CLINIC')
,('DAVID', '3-4-2014', 'CLINIC')
,('DAVID', '3-15-2014', 'ER')
SELECT *
FROM @Init_DataSource
ORDER BY 1 DESC, 2 ASC
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE