I am using SQL Server and moving data from an address table with the following layout
ADDRLine1
ADDRLine2
ADDRLine3
ADDRLine4
ADDRCity
ADDRCounty
ADDRPostcode
Into another database that only has two address fields
ADDRLine1
ADDRLine2
ADDRCity
ADDRCounty
ADDRPostcode
The fields need to be mapped sensibly like this:
INPUT |OUTPUT
Add1 |Add2 | Add3 |Add4 |Add1 |Add2
----------------------------------------------------------
Filled |Filled |Filled |Filled |Add1, Add2 |Add3, Add4
Filled |Filled |Filled |NULL |Add1, Add2 |Add3
Filled |Filled |NULL |NULL |Add1 |Add2
Filled |NULL |NULL |NULL |Add1 |
Can this be done with a SELECT statement so that I can use it in a view?
3