I have a table with the below structure and data.
I want to convert the above data as below table structure, where the status column contains the direction of the log, IN or OUT (0 indicates IN and 1 indicates OUT). If timein has value then it shows as in time i.e. 0 and if timeout has value it will show as 1.
Please help me to write a SQL Server query to get the output.