I know that the question is too old, anyway:
SELECT a, b
FROM mytable
GROUP BY a, b;
This will give your all the combinations.
More Related Contents:
- How can I SELECT rows with MAX(Column value), PARTITION by another column in MYSQL?
- Count the occurrences of DISTINCT values
- What’s faster, SELECT DISTINCT or GROUP BY in MySQL?
- Selecting distinct 2 columns combination in mysql
- get first occurrence of last changed value of a column [closed]
- MySQL – Rows to Columns
- ROW_NUMBER() in MySQL
- multiple query same table but in different columns mysql
- How can I make SQL case sensitive string comparison on MySQL?
- How can I temporarily disable a foreign key constraint in MySQL?
- How to do a batch insert in MySQL
- Ordering by the order of values in a SQL IN() clause
- Creating a “Numbers Table” in MySQL
- SQL Selecting from two Tables with inner join and limit [duplicate]
- MySQL Group by SUM
- Set NOW() as Default Value for datetime datatype?
- In SQL, how to select the top 2 rows for each group
- Mysql query to dynamically convert rows to columns on the basis of two columns
- Why do results from a SQL query not come back in the order I expect?
- How to generate data in MySQL?
- MySQL combine two columns and add into a new column
- How to skip certain database tables with mysqldump?
- MySQL error 1241: Operand should contain 1 column(s)
- How to set a MySQL row to READ-ONLY?
- Mysql: Order by like?
- Getting first day of the week in MySql using Week No
- SQL date format convert? [dd.mm.yy to YYYY-MM-DD]
- INSERT INTO Table from multiple tables
- Execute INSERT if table is empty?
- Mysql How do you create a clustered index?