cliftonbazaar Posted January 13, 2010 Share Posted January 13, 2010 I know that I can SELECT whichever fields I want to use but if I have over 100 fields in a record (and I use nearly all of them) is there anyway of SELECTing all the fields except 3 that I don't want to load? (I do have my reasons for this) Quote Link to comment https://forums.phpfreaks.com/topic/188305-selecting-but-3-fields/ Share on other sites More sharing options...
dgoosens Posted January 13, 2010 Share Posted January 13, 2010 you could work as described here: http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/ 1. you get the list of all your columns 2. you go through the list and exclude the columns 3. you create the query Quote Link to comment https://forums.phpfreaks.com/topic/188305-selecting-but-3-fields/#findComment-994096 Share on other sites More sharing options...
PFMaBiSmAd Posted January 13, 2010 Share Posted January 13, 2010 The whole point of programming is to produce code that efficiently accomplishes a specific task. Without knowing the reason why you don't want to select the three columns is not actually possible to give you the best answer. However, if you have a table with over 100 columns, you likely have a bad table design and need to normalize the data first before you worry about the affect of not selecting just three of them or how you would ignore those three when you process the results in your presentation code. Quote Link to comment https://forums.phpfreaks.com/topic/188305-selecting-but-3-fields/#findComment-994132 Share on other sites More sharing options...
trq Posted January 13, 2010 Share Posted January 13, 2010 I would have to agree with PFMaBiSmAd here, 100 fields wreaks of poor design. Quote Link to comment https://forums.phpfreaks.com/topic/188305-selecting-but-3-fields/#findComment-994135 Share on other sites More sharing options...
aebstract Posted January 13, 2010 Share Posted January 13, 2010 I think he means that he has over 100 rows in his table. Which if that is the case, we still need to know some more information to even help you isolate those results. Quote Link to comment https://forums.phpfreaks.com/topic/188305-selecting-but-3-fields/#findComment-994305 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.