graham23s Posted January 2, 2009 Share Posted January 2, 2009 Hey Guys, i have my query like this: $q_sold = "SELECT `PRODUCT_ID`, SUM(QUANTITY) as `QTY` FROM `fcp_orders_master_log` GROUP BY `PRODUCT_ID` ORDER BY `QTY` DESC"; i was wanting to add another clause to it: WHERE `PROCESSED`='Y' i didn't want to tamper with it just incase i mucked it up lol is it ok to just append this to the end or would i need to do more to it? thanks guys Graham Link to comment https://forums.phpfreaks.com/topic/139188-adding-more-to-a-query/ Share on other sites More sharing options...
DarkWater Posted January 2, 2009 Share Posted January 2, 2009 It has to go between `fcp_orders_master_log` and GROUP BY. Is there a particular reason you use caps when creating field names? Just curious. I can never understand why people do it. Link to comment https://forums.phpfreaks.com/topic/139188-adding-more-to-a-query/#findComment-728026 Share on other sites More sharing options...
graham23s Posted January 2, 2009 Author Share Posted January 2, 2009 it's crazy i personally do the capitals to distinguish between the mysql code and my tables it's easier on the eye i think lol i used to think if it wasn't capitals it wouldn't work so as a rule of thumb i just stuck with it thanks DW Graham Link to comment https://forums.phpfreaks.com/topic/139188-adding-more-to-a-query/#findComment-728104 Share on other sites More sharing options...
revraz Posted January 2, 2009 Share Posted January 2, 2009 That is actually the reason Not to make them Caps. it's crazy i personally do the capitals to distinguish between the mysql code and my tables it's easier on the eye i think lol Link to comment https://forums.phpfreaks.com/topic/139188-adding-more-to-a-query/#findComment-728107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.