I'm pretty sure this is possible, don't know if maybe I need to use an index, nor do I know whether I should use an index.
What I have is contacts table with nearly 30 columns. 10 are for personal details, and 10 are for office details. I then have two fields, one to say add personal details to public address book, another to say add office details to public address book. There is no "public address book" table, I'm just going to pull the details from the contacts table where these values are set to Y.
What I want to do is basically the following, using one select statement:
Do I need to create an "alias" of some kind for the 10 "home" fields and another for the 10 "office" fields, or how do I do this?
any help would be greatly appreciated
What I have is contacts table with nearly 30 columns. 10 are for personal details, and 10 are for office details. I then have two fields, one to say add personal details to public address book, another to say add office details to public address book. There is no "public address book" table, I'm just going to pull the details from the contacts table where these values are set to Y.
What I want to do is basically the following, using one select statement:
Code:
SELECT home_address1, home_address2 ... FROM contacts WHERE home_public = 'Y', SELECT office_address1 ... FROM contacts WHERE office_public = 'Y'
any help would be greatly appreciated