newtonrealman Posted July 30, 2009 Share Posted July 30, 2009 Hi! Wanted to select * from students but wanted to filter out the Age for example Basically i want to write up a query in which i would specify columns i dont want rather than the ones i do. Thanks. Newton Link to comment Share on other sites More sharing options...
0 jakem1 Posted July 30, 2009 Share Posted July 30, 2009 All you have to do is include the names of the columns you want in the select clause. For example: SELECT student_id, firstname, surname FROM students You have to list the columns you want to include rather than exclude the ones you're not interested in. Link to comment Share on other sites More sharing options...
0 newtonrealman Posted July 30, 2009 Author Share Posted July 30, 2009 i know that, but i am dealing with tables with over 20 columns. Thats why i was wondering if there was a way of selecting a table and excluding the ones im not interested in. Link to comment Share on other sites More sharing options...
0 James Rose Posted July 30, 2009 Share Posted July 30, 2009 Sorry, the SQL language does not allow for ALL, EXCEPT(A,B,) Interesting idea thought. You'll have to start learning that creating big queries involves a good editor (my fav is Toad) or a good ability to know the language. btw: 20 fields is not that many. Good luck Link to comment Share on other sites More sharing options...
0 Rohdekill Posted August 1, 2009 Share Posted August 1, 2009 Just select * and refer to, or display the columns you want. Link to comment Share on other sites More sharing options...
0 BGM Posted August 1, 2009 Share Posted August 1, 2009 btw: 20 fields is not that many. depends what type of application it is ;) Link to comment Share on other sites More sharing options...
0 Rohdekill Posted August 2, 2009 Share Posted August 2, 2009 depends what type of application it is ;) The type of application is meaningless. The type of data and number of rows is important. Memory is used to hold the info. Link to comment Share on other sites More sharing options...
0 tsupersonic Posted August 2, 2009 Share Posted August 2, 2009 20 fields? Sheesh, at that point, you're better off creating 2 smaller tables with like half the columns, rather than 1 big table with all the columns Link to comment Share on other sites More sharing options...
0 BGM Posted August 2, 2009 Share Posted August 2, 2009 The type of application is meaningless.The type of data and number of rows is important. Memory is used to hold the info. ok, thats true as well transactional application 20 cols is not many, analytical is a different kettle of fish (depending on datatype and number of rows) Link to comment Share on other sites More sharing options...
Question
newtonrealman
Hi!
Wanted to select * from students
but wanted to filter out the Age for example
Basically i want to write up a query in which i would specify columns i dont want rather than the ones i do.
Thanks.
Newton
Link to comment
Share on other sites
8 answers to this question
Recommended Posts