Hi, I have about 30+ columns in my table. I want to select all columns but one column (which has to come from another table). Do I have to specify each column name in the select clause or is there an easier and a better way of doing it?
As far as I know, you can't create a query that specifies all-columns-except-for-one, or anything like that. So yes: in your case I believe you need to specify each of the columns you want.
Joined: Jul 11, 2005
What I have done to get around this is: In the select I get all columns i.e. * from the main table, and I select the column I want from another table and the alias name for this column is same as the column name I want to exclude.
When I execute the query in the database it gives me both the columns in the data output; but with JDBC while retrieving the values, when I invoke getString("<alias_name>") it gives me the value of the column from the second table. Thats what I need so my problem gets solved.