How to get unique values from 2 columns in postgresql?

by elisha_langworth , in category: MySQL , 5 months ago

How to get unique values from 2 columns in postgresql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by aubrey , 5 months ago

@elisha_langworth 

To get unique values from 2 columns in PostgreSQL, you can use the following query:

1
2
SELECT DISTINCT column1, column2
FROM your_table;


Replace your_table, column1, and column2 with the actual table name and column names that you want to get unique values from. This query will return a list of unique combinations of values from column1 and column2 in your table.