Question : Create select statement using multiple tables with no logical joins

I need to create a select statement to be used to fill a VB.NET datagrid where the tables are customer, driver and vendor tables.
There are no specific fields that I would use to join with them but I need to combine 'like' fields into a record set.  The only field
that I would filter on which is common to each table is a flag as to whether the rows have been imported into a third-party accounting
table.... P_Imported (bit)

For simplicity in using only two fields/table, this is what the fields would be in each table:

customer - customer_name (varchar), customer_phone (varchar)
driver - driver_name (varchar), driver_phone (varchar)
vendor - vendor_name (varchar), vendor_phone (varchar)

I would generate the select fields customer_name AS name, customer_phone AS phone


Thanks in advance.

Phil Tate

Answer : Create select statement using multiple tables with no logical joins

try this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
select customer_name as name, customer_phone as phone
from customer
where p_imported = 1
union ALL
select driver_name, driver_phone
from driver
where p_imported = 1
union ALL
select vendor_name venor_phone
from customer
where p_imported = 1
Random Solutions  
 
programming4us programming4us