MaeM Posted August 5, 2014 Share Posted August 5, 2014 Hi, Everyone! This my first time posting here. Anyways, I've been having problem getting the correct data from my database. I want to select the total_on/off_hours,exposure,plate_number, and terminal_status. But when I select the terminal_status, there are duplicates, I already used the DISTINCT function. It's a little hard to explain so, I'll just show you. Here's a screen cap of my code trying to get just the terminal_status What's the problem? What should I do? Any suggestions/help will be much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/290275-select-query/ Share on other sites More sharing options...
phpPeter Posted August 5, 2014 Share Posted August 5, 2014 I can't see duplicates. E.g. UVM 955 is listed twice, but one time for terminal status OFFLINE, another time for ONLINE. This seems to be correct. Maybe you can explain a bit more detailed, what you are trying to do.... BTW: Distinct is a bad idea in aggregating queries. You have to define the "group by" clause consistent to the grouping functions. Otherwise, it will not work. If you can explain more detailed, it's easier to solve your issue. Quote Link to comment https://forums.phpfreaks.com/topic/290275-select-query/#findComment-1486924 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.