Column wise listing

am_sarath

Registered User.
Local time
Today, 06:09
Joined
Sep 19, 2001
Messages
29
Hello

I am trying to display records in my list box from 3 tables using the following query.

SELECT [Field1],[Field2] FROM Table1 UNION SELECT[Field1],NULL FROM Table2; UNION SELECT [Field1],NULL from Table3;

I am able to list all the records in the list box from my tables.
but, i want it to be listed in column wise.

Like it should look in the following fashion in my list box.

FIELD1 FIELD2 FIELD1 FIELD1
(Table1) (Table1) (Table2) (Table3)

How can it be done.any suggestions would be appreciated.
 
SELECT [Field1] AS [NewFieldName1], [Field2] AS [NewFieldName2], NULL AS [NewFieldName3], NULL AS [NewFieldName4] from Table1

UNION SELECT NULL AS [NewFieldName1], NULL AS [NewFieldName2], [Field1] AS [NewFieldName3], NULL AS [NewFieldName4] from Table2

UNION SELECT NULL AS [NewFieldName1], NULL AS [NewFieldName2], NULL AS [NewFieldName3], [Field1] AS [NewFieldName4] from Table3
 

Users who are viewing this thread

Back
Top Bottom