Jump to content

Select query


MaeM

Recommended Posts

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

 

10470771_10152563036105395_8062125593388

 

 

What's the problem? What should I do? Any suggestions/help will be much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/290275-select-query/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/290275-select-query/#findComment-1486924
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.