JD* Posted September 11, 2010 Share Posted September 11, 2010 I wasn't really sure how to phrase the subject and I'm not sure if this can be done, but lets see: I have yearly data that is stored like this: Name | Agreed --------|---------- Joe | 2009-2010,2010-2011 Mary | 2009-2010 What I'm trying to do is make a query for a drop down list that will say "Please choose a year range" and I want to avoid hand coding it, but rather list only those years that have already been entered by people. Since each date isn't stored in a separate column I don't think I can do group by. Anyone have some thoughts on if it can be accomplished? Link to comment https://forums.phpfreaks.com/topic/213179-selecting-data-used-in-a-find_in_set-type-query/ Share on other sites More sharing options...
fenway Posted September 12, 2010 Share Posted September 12, 2010 That's not a normalized table structure. Link to comment https://forums.phpfreaks.com/topic/213179-selecting-data-used-in-a-find_in_set-type-query/#findComment-1110132 Share on other sites More sharing options...
JD* Posted September 12, 2010 Author Share Posted September 12, 2010 So.... I take it that means it's not possible? Link to comment https://forums.phpfreaks.com/topic/213179-selecting-data-used-in-a-find_in_set-type-query/#findComment-1110201 Share on other sites More sharing options...
fenway Posted September 13, 2010 Share Posted September 13, 2010 Oh, it's possible, and FIND_IN_SET() should work -- it's just not advisable. Link to comment https://forums.phpfreaks.com/topic/213179-selecting-data-used-in-a-find_in_set-type-query/#findComment-1110449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.