tags:

views:

51

answers:

2

I would rather not have to list all columns in tableA The '*' works for one table, but I don't want to get back all columns in tableB from JOIN. Reason being, these records are being deleted, and I want to store data from tableA (only) as serialized xml for period of time.

+6  A: 
select tableA.*, tableB.col1, tableB.col2, ...
KennyTM
@Martin She/he said she/he *doesn't* want all columns in tableB
NullUserException
@Null - Absolutely Correct - I must need another coffee.
Martin Smith
+1  A: 

It is a poor practice to ever use select * or select table1.*. It is bad for maintenance and performance both. You should never do that in production code.

Just use the column names that you want.

HLGEM
That's good to know. It would still be nice to know the newly added columns would be included automatically from TableA. If this wasn't a query for records to be deleted, I would definitely code all column names needed for query. In this case, I need to serialize all data in case a restore needs to be done. Thanks,
john pavelka