Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in SQL by (6.1k points)

In MySQL, Is it possible to GROUP BY more than one column using the SELECT query? 

For example:

GROUP BY fV.tier_id AND 'f.form_template_id'

1 Answer

0 votes
by (12.7k points)
edited by

Yes. In MySQL, we can group by multiple columns. 

Check out the below example,

SELECT * FROM table
GROUP BY col1, col2

The result will be initially grouped by col1, and then by col2. Also In MySQL, the column preference goes from left to the right.

Start your SQL career with the perfect SQL Training Course now!

Related questions

0 votes
2 answers
0 votes
2 answers
0 votes
1 answer
asked Jul 19, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...