sql server - SQL Select for create daily log data from more than one date column frrom a single table -


i have table more 1 date column,
each date column hold date or null value,

want write sql query display each column have date new row new additional column named logdate contain same date of column.

difficult explain, please referrer attached image.

enter image description here

just use union all concatenate 3 result sets:

select [receiveddate] logdate, * mytable [receiveddate] not null union select [closing date] logdate, * mytable [closing date] not null union select [lpodate] logdate, * mytable [lpodate] not null 

to sort logdate add following order clause end of query:

order logdate 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -