There is a table for reference
DB table - words
word | description --------+----------------------------------------------------------------------------- ΠΊΠΎΡ | Π‘Π°ΠΌΠ΅Ρ ΠΊΠΎΡΠΊΠΈ ΠΊΠΎΡ | Π‘Π°ΠΌΠ΅Ρ ΠΊΠΎΡΠΊΠΈ ΡΠ΅ΠΌΠ΅ΠΉΡΡΠ²Π° ΠΊΠΎΡΠ°ΡΡΠΈΡ
ΠΎΡΡΡΠ΄Π° Ρ
ΠΈΡΠ½ΡΡ
ΠΊΠΎΡ | ΠΠΎΠΌΠ°ΡΠ½Π΅Π΅ ΠΆΠΈΠ²ΠΎΡΠ½ΠΎΠ΅ ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΠ΄Π½ΠΈΠΌ ΠΈΠ· ΠΏΠΎΠ΄Π²ΠΈΠ΄ΠΎΠ² Π΄ΠΈΠΊΠΎΠΉ ΠΊΠΎΡΠΊΠΈ Π±Π΅Π³Π΅ΠΌΠΎΡ | ΠΡΡΠΏΠ½ΠΎΠ΅ ΠΏΠ°ΡΠ½ΠΎΠΊΠΎΠΏΡΡΠ½ΠΎΠ΅ ΠΌΠ»Π΅ΠΊΠΎΠΏΠΈΡΠ°ΡΡΠ΅Π΅ Π±Π΅Π³Π΅ΠΌΠΎΡ | ΠΡΡΠΏΠ½ΠΎΠ΅ ΠΏΠ°ΡΠ½ΠΎΠΊΠΎΠΏΡΡΠ½ΠΎΠ΅ ΠΌΠ»Π΅ΠΊΠΎΠΏΠΈΡΠ°ΡΡΠ΅Π΅ Ρ ΠΌΠ°ΡΡΠΈΠ²Π½ΡΠΌ ΡΡΠ»ΠΎΠ²ΠΈΡΠ΅ΠΌ ΠΈ ΠΊΠΎΡΠΎΡΠΊΠΈΠΌΠΈ Π½ΠΎΠ³Π°ΠΌΠΈ For each term, it is necessary to delete all partial duplication of definitions from the reference book, leaving only the most complete non-repeating
Expected result after the request
word | description --------+----------------------------------------------------------------------------- ΠΊΠΎΡ | Π‘Π°ΠΌΠ΅Ρ ΠΊΠΎΡΠΊΠΈ ΡΠ΅ΠΌΠ΅ΠΉΡΡΠ²Π° ΠΊΠΎΡΠ°ΡΡΠΈΡ
ΠΎΡΡΡΠ΄Π° Ρ
ΠΈΡΠ½ΡΡ
ΠΊΠΎΡ | ΠΠΎΠΌΠ°ΡΠ½Π΅Π΅ ΠΆΠΈΠ²ΠΎΡΠ½ΠΎΠ΅ ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΠ΄Π½ΠΈΠΌ ΠΈΠ· ΠΏΠΎΠ΄Π²ΠΈΠ΄ΠΎΠ² Π΄ΠΈΠΊΠΎΠΉ ΠΊΠΎΡΠΊΠΈ Π±Π΅Π³Π΅ΠΌΠΎΡ | ΠΡΡΠΏΠ½ΠΎΠ΅ ΠΏΠ°ΡΠ½ΠΎΠΊΠΎΠΏΡΡΠ½ΠΎΠ΅ ΠΌΠ»Π΅ΠΊΠΎΠΏΠΈΡΠ°ΡΡΠ΅Π΅ Ρ ΠΌΠ°ΡΡΠΈΠ²Π½ΡΠΌ ΡΡΠ»ΠΎΠ²ΠΈΡΠ΅ΠΌ ΠΈ ΠΊΠΎΡΠΎΡΠΊΠΈΠΌΠΈ Π½ΠΎΠ³Π°ΠΌΠΈ PS - please note
1) definitions can also be long, one thousand characters or more
2) the number of records in the table - several hundred thousand
I try this:
select word, distinct(description) from words What am I doing wrong and how to write the right query?