Home > Archive > microsoft.public.sqlserver.server > November 2002 > Select all from two tables except one column from one......





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Select all from two tables except one column from one......
Frank

2002-11-28, 4:23 am

Hi.
I have to tables with multiple columns in each table (20 or more) with
one common key (meeting_id). I want to select all columns (*) from
both tables exept one of the meeting_id columns (select a.*, b.* into
"new table*).
Since the new table do not handle duplicate column names, I want to
specify select a.*, b.* (except meeting_id for table B). Do I have to
list all the columns I want to use in a select list for b.* or is
there any way to list the columns i don't want to use??
Any help would be appriciated!!!

Regards Frank
Allan Mitchell

2002-11-28, 4:23 am

IMHO you will need to specify the column list

--



Allan Mitchell (Microsoft SQL Server MVP)
www.SQLDTS.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org



"Frank" <feite_frank@hotmail.com> wrote in message
news:bd47eaa5.0211280131.4858fae2@posting.google.com...
> Hi.
> I have to tables with multiple columns in each table (20 or more) with
> one common key (meeting_id). I want to select all columns (*) from
> both tables exept one of the meeting_id columns (select a.*, b.* into
> "new table*).
> Since the new table do not handle duplicate column names, I want to
> specify select a.*, b.* (except meeting_id for table B). Do I have to
> list all the columns I want to use in a select list for b.* or is
> there any way to list the columns i don't want to use??
> Any help would be appriciated!!!
>
> Regards Frank



Tibor Karaszi

2002-11-28, 4:23 am

Frank,

There is no "* except these columns" in the SQL language. Btw, using SELECT * is considered bad
programming practice, and quite often is source for bugs (table alterations etc). I never do
SELECT * in production code.

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=...ublic.sqlserver


"Frank" <feite_frank@hotmail.com> wrote in message
news:bd47eaa5.0211280131.4858fae2@posting.google.com...
> Hi.
> I have to tables with multiple columns in each table (20 or more) with
> one common key (meeting_id). I want to select all columns (*) from
> both tables exept one of the meeting_id columns (select a.*, b.* into
> "new table*).
> Since the new table do not handle duplicate column names, I want to
> specify select a.*, b.* (except meeting_id for table B). Do I have to
> list all the columns I want to use in a select list for b.* or is
> there any way to list the columns i don't want to use??
> Any help would be appriciated!!!
>
> Regards Frank



Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net