oskare100 Posted February 1, 2007 Share Posted February 1, 2007 Hello, I need to select all rows * from a MySQL database where the dec column ends with 0 (or contains 0 if it is easier). How can I do that? Best Regards Quote Link to comment https://forums.phpfreaks.com/topic/36658-select-all-rows-where-the-dec-row-contains-or-ends-with-0/ Share on other sites More sharing options...
artacus Posted February 1, 2007 Share Posted February 1, 2007 It probably shouldn't work, but it does. You can use like '%0' on and int column. Quote Link to comment https://forums.phpfreaks.com/topic/36658-select-all-rows-where-the-dec-row-contains-or-ends-with-0/#findComment-174761 Share on other sites More sharing options...
effigy Posted February 1, 2007 Share Posted February 1, 2007 Contains: SELECT * FROM table WHERE LOCATE('0', field) Quote Link to comment https://forums.phpfreaks.com/topic/36658-select-all-rows-where-the-dec-row-contains-or-ends-with-0/#findComment-174766 Share on other sites More sharing options...
fenway Posted February 1, 2007 Share Posted February 1, 2007 It probably shouldn't work, but it does. You can use like '%0' on and int column. It definitely shouldn't... I'd prefer it you acually did some math to check it. Quote Link to comment https://forums.phpfreaks.com/topic/36658-select-all-rows-where-the-dec-row-contains-or-ends-with-0/#findComment-174774 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.