What's the most concise way in sql to select from 5 different tables..
I want some data from each.. but mainly the telephone numbers found in each of these tables..
The ultimate goal is to create a type of phone book, so when someone searches in the phone number input box it returns all the phones numbers that match from those five different categories (tables).....
any help would be greatly appreciated.
Here's what i have now...
Code:
select
code,
first,
last,
phoneday,
phonenight,
dfcode
from event.dbo.patient_dg()
select
id,
doctor_id,
phone,
fax
from event.dbo.doctor_alt_address
select
CODE_,
NAME_,
PHONE,
FAX
from ARE.APS.RFDME
select
CODE_,
FIRST_,
LAST_,
PHONE,
FAX
from ARE.APS.DFDME
Select *
from pharmacy.dbo.chain
Select *
from crm.dbo.rf_contacts
Thanks Nogdog, I'm still working on it... i see what you've done there...
Here's how I've done it:
PHP Code:
<?php
$module = 'Phone Book';
$table = event_table('patient_dg()');
$alias = array(
0=>array('code'=>'ID'),
1=>array('first'=>'First'),
2=>array('last'=>'Last'),
3=>array('phoneday'=>'Phone'),
4=>array('phonenight'=>'Phone_2')
);
$where_list = array();
$search = array(3);
$show = array(0,1,2,3,4);
$order = array(1);
$newlink = matry::base_to('phone_book/new');
$rowlink = matry::base_to('phone_book/lookup');
I'm only showing the phoneday input box which is what i wanted... but i still can't figure out how to get the other select (data) statements from the other tables to appear in my queries.