Home All Groups Group Topic Archive Search About

two tables select fields

Author
24 Sep 2005 9:33 PM
jkmambo
Suppose I have two tables A and B

Table A has fields A1, A2, A3, ... A9
Table B has fields B1, B2, B3, ... B9

I want to select all fields in A and only B3 in table B. I dont want to
list individual fields for A because they are too many I simply want to
use a *.

How do I do this?
I tried this way but they are not working
Select * from A1, B3 from B 
Select *, B3 from A, B  


Thanks
John

Author
24 Sep 2005 10:01 PM
jkmambo
Ok I have figured out how to do it
its
select A.*, B.B3 from A, B
Author
24 Sep 2005 10:11 PM
Dan Guzman
Your query will yeild the desired column list but probably not the desired
results, unless you want a Cartesian product.  I suspect you want to join
the tables:

SELECT A.*, B.B3
FROM A
JOIN B ON A1 = B1

--
Hope this helps.

Dan Guzman
SQL Server MVP

<jkma***@gmail.com> wrote in message
Show quote
news:1127598599.423793.238970@g49g2000cwa.googlegroups.com...
> Ok I have figured out how to do it
> its
> select A.*, B.B3 from A, B
>

AddThis Social Bookmark Button