sql - how to combine two columns of integer in PostgreSQL? -


i have following query:

select col1, col2 ... where... 

which gives:

col1  col2 5        17 4       5 12 5        20 4      17 2       3 

i want convert 1 column no duplicates follows:

col3 5 17 4 12 20 2 3 

how can that? read topic combine 2 columns , add 1 new column it's not need... operator || won't here.

edit: col3 list of numbers appear in col2 , col1.

it seems need union

select col1 col3 t col1 not null union select col2 col3 t col2 not null 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -