[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

Select query in sql 2000

RickSean

3/28/2007 12:55:00 AM

I have a table TableA (Col1, Col2, Col3) which contains 5000 records. Col1 is
the key field.
Another table TableB (Col1, Cola, Colb) contains 300 records, Col1 is the
key field.
Another table TableC (Col1, Cola1, Colb1) contains 100 records, Col1 is the
key field.

I want to return all 5000 records from TableA in the following format:
Output:
Col1 Col2 Col3 Cola Colb1

If TableA or TableB does not contain a value for Col1 then Cola and Colb1
should output NULL in the result set.

If my question can be answered without a ddl; it would be highly
appreciated. Otherwise, i will try to post a ddl.
1 Answer

kk

3/28/2007 1:53:00 AM

0

Use OUTER JOINs between the table. Always post DDL and sample data so that we
can understand the problem easly.
--
Krishnakumar S

What lies behind you and what lies before you is nothing compared to what
lies within you


"RickSean" wrote:

> I have a table TableA (Col1, Col2, Col3) which contains 5000 records. Col1 is
> the key field.
> Another table TableB (Col1, Cola, Colb) contains 300 records, Col1 is the
> key field.
> Another table TableC (Col1, Cola1, Colb1) contains 100 records, Col1 is the
> key field.
>
> I want to return all 5000 records from TableA in the following format:
> Output:
> Col1 Col2 Col3 Cola Colb1
>
> If TableA or TableB does not contain a value for Col1 then Cola and Colb1
> should output NULL in the result set.
>
> If my question can be answered without a ddl; it would be highly
> appreciated. Otherwise, i will try to post a ddl.