kfurlong Posted October 12, 2010 Share Posted October 12, 2010 Hello everyone,I am having trouble writing a query. I can write simple ones, but I am getting a little overwhelmed with these. Basically here is what I havecompletion_counter_data:Date | Status_Name | Department | Cell | Assembly | Todays Date Completed New Department Cell Assembly Todays Date Completed Rework Department Cell Assembly Todays Date Failed Department Cell Assembly Todays Date Failed Department Cell Assembly Todays Date Failed Department Cell Assembly Todays Date Failed Department Cell Assembly Basically I want to select the number of rows for each Status_Name for each Assembly for each cell with a static department in a specific date range. So the example table above would return---------------------------------Department---> Cell----------->Assembly-------------------->Completed New------------------------------>1-------------------->Completed Rework------------------------------>1-------------------->Failed------------------------------>4 But there will be more assemblies. in each cell and more cells in a static department. I have another query problem, but maybe it can be solved by knowing th answer to this. Any help is greatly appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/215718-query-trouble/ Share on other sites More sharing options...
fenway Posted October 17, 2010 Share Posted October 17, 2010 Then you need to use GROUP BY. Quote Link to comment https://forums.phpfreaks.com/topic/215718-query-trouble/#findComment-1122976 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.