sKunKbad Posted June 4, 2014 Share Posted June 4, 2014 As a freelancer working alone, I've got to wear all the hats, doing all the front end and back end design and development. So perhaps I'm never really specializing in any one thing, and I tend to miss some good stuff, like MySQL GROUP BY. Doing counts of things using GROUP BY is very handy. I saw somebody doing that in a thread, and adapted it to two things that I was working on in the last week. Sweet! What other fun MySQL stuff am I missing out on? Quote Link to comment https://forums.phpfreaks.com/topic/288972-mysql-group-by-is-pretty-awesome/ Share on other sites More sharing options...
Psycho Posted June 4, 2014 Share Posted June 4, 2014 Well, GROUP BY is a pretty standard SQL syntax that isn't specific to MySQL. If you were not aware of that, there's no telling what you are not familiar with: ORDER BY, LIMIT, etc. The MySQL manual isn't as easy to digest as the PHP one is. You can go here: http://dev.mysql.com/doc/refman/5.0/en/functions.html which is the base page for "functions". You can then select one of the links for areas such as "String Functions", "Data Functions", etc. You'll then get a list of functions in the selected area. Typically those pages have a list of the functions and a short description at the top of the page. Quote Link to comment https://forums.phpfreaks.com/topic/288972-mysql-group-by-is-pretty-awesome/#findComment-1481857 Share on other sites More sharing options...
sKunKbad Posted June 5, 2014 Author Share Posted June 5, 2014 Well, GROUP BY is a pretty standard SQL syntax that isn't specific to MySQL. If you were not aware of that, there's no telling what you are not familiar with: ORDER BY, LIMIT, etc. The MySQL manual isn't as easy to digest as the PHP one is. You can go here: http://dev.mysql.com/doc/refman/5.0/en/functions.html which is the base page for "functions". You can then select one of the links for areas such as "String Functions", "Data Functions", etc. You'll then get a list of functions in the selected area. Typically those pages have a list of the functions and a short description at the top of the page. As you say, I'm sure it is pretty standard SQL syntax. I've used ORDER BY and LIMIT to do pagination many times, and I've also created and used stored procedures quite a bit. I've been working with MySQL for years, and I feel comfortable with using it, which happens every day actually. I have read a couple books on MySQL, but I think I have a habit of skimming over things I don't think I will use, and that's probably contributing to why I didn't see the usefulness of GROUP BY. I really don't like the MySQL docs. PHP has great docs when compared to MySQL. Also, I like real world examples, which the docs don't have a lot of. That's why when I saw the usage of GROUP BY I was so pleased. I have a lot of goals, and one is to have a more complete understanding of MySQL. For instance, I'm not really able to understand the usefulness of MySQL VIEWS. Quote Link to comment https://forums.phpfreaks.com/topic/288972-mysql-group-by-is-pretty-awesome/#findComment-1481916 Share on other sites More sharing options...
Psycho Posted June 5, 2014 Share Posted June 5, 2014 As you say, I'm sure it is pretty standard SQL syntax. I've used ORDER BY and LIMIT to do pagination many times, and I've also created and used stored procedures quite a bit. I've been working with MySQL for years, Well, I'm surprised how someone could work with MySQL for years and not use GROUP BY. There are many basic features that require it. Well, I guess you could always query all the ungrouped records and then get the results by processing all the individual records in the code. But, my god, what a waste that would be. Anyway, that is why I have a hard time telling you that function "X" is another one you would benefit from. GROUP BY is pretty pedestrian in my opinion. I would still suggest reading the names of the functions and their descriptions in the manual. You would then at least have an idea of what is available. Then, if you find a need for something, you can do the extra research to learn how to use it. Quote Link to comment https://forums.phpfreaks.com/topic/288972-mysql-group-by-is-pretty-awesome/#findComment-1481940 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.