Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Split records T-SQL

$
0
0

Hi Friends,

I have a full record which does have single and return information in the same record so I want to split into two records using SQL

have a look attached below screen shot this is the Input I have

 The below output I am expecting using SQL code

Can anyone guide me how to do this?

below is my SQL Query.

SELECT 
       [BookID]
      ,[DepartureDate]
      ,[DepartureAirportfldId]
      ,[DepartureAirportAirportName]
	  ,[ArrivalAirportfldId]
	  ,[ArrivalAirportAirportName]
      ,[ReturnDate]
      ,[ReturnDepartureAirportfldId]
      ,[ReturnDepartureAirportAirportName]
	  ,[ReturnArrivalAirportfldId]
      ,[ReturnArrivalAirportAirportName]
      ,[PassengerName]
  FROM [Test]
Thanks for your help.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>