If a person has got two addresses then I need post a letter for both the addresses otherwise post to the letter to the family address which is one.
SELECT id, firstname, lastname, address, postcode, email
From constituent
The data I have is as below:
10001,Esther,Wheels,101 Rosehill, WA1878,sue.w@hotmail.com
10001,Esther,wheels,30 miles rd, 123UDF,hws.isthe@hotmail.com
10001,Esther,Wheels,101 Rosehill, WA1878,
How to put this information in a single row showing id,firstname,lastname, address1,postcode1,address2,postcode2,email1,email2,First
Family(flag), Second family(x)? If there is no second address it should show just one address.
Please help?