Have a simple request to do a mail list.
Join the Client with the Client Address Table
No Problemo.
Almost.
What if the are more than one address for a client?
Say that the Client address table stores the addresses and has a change_date field.
I would want the top/bottom record sorted by change_date [Asc/desc] to pick of the most recent/current address.
Do I use a view with 5 Select subqueries to get the address info or Do I write a sp?
Thanks MikeD
Here is the simple join
select c.fullname,
ca.Address as adr1,ca.Address1 as Adr2,
ca.CITY,ca.state,ca.zip
from client c,client_address ca
where c.clientkey=ca.clientkey
Join the Client with the Client Address Table
No Problemo.
Almost.
What if the are more than one address for a client?
Say that the Client address table stores the addresses and has a change_date field.
I would want the top/bottom record sorted by change_date [Asc/desc] to pick of the most recent/current address.
Do I use a view with 5 Select subqueries to get the address info or Do I write a sp?
Thanks MikeD
Here is the simple join
select c.fullname,
ca.Address as adr1,ca.Address1 as Adr2,
ca.CITY,ca.state,ca.zip
from client c,client_address ca
where c.clientkey=ca.clientkey