i have a table with 17 columns i want 16 columns to select. is there another way to write it than SELECT [all tablenames that i want] .... query?
thanks,
have a nice day
select all columns except one?
Moderator: General Moderators
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
Select * is the easiest thing to do, but I would certainly resist the temptation. Bite the bullet and code all 16 columns in the select statement.
By doing so, you have also documented the portion of the table structure of interest to this script. 6 months, a year from now when you have to update the script, you will be glad you did! Also format your sql in a readable manner:
Select colA
, colB
, colC
, colD
FROM Table A
WHERE colB = $somevalue
AND colC = $anothervalue
ORDER BY colB, colC
A little extra work upfront, but anything you can do to make your script more readable and easy to understand will profit you immensely in the future.
fv
By doing so, you have also documented the portion of the table structure of interest to this script. 6 months, a year from now when you have to update the script, you will be glad you did! Also format your sql in a readable manner:
Select colA
, colB
, colC
, colD
FROM Table A
WHERE colB = $somevalue
AND colC = $anothervalue
ORDER BY colB, colC
A little extra work upfront, but anything you can do to make your script more readable and easy to understand will profit you immensely in the future.
fv