简体   繁体   中英

Getting DISTINCT values from 3 columns

I have 1 single table with 3 columns say col1,col2,col3

VALUES:

col1 with values (in individual 3 rows) as a, b, c
col2 with values (in individual 3 rows) as b, c, d
col3 with values (in individual 3 rows) as c, d, e

AIM:

To get distinct list to populate in html drop down box (ie i want a,b,c,d,e) in alphabetical order ?

Pseudocode:

Select col1 from table
UNION
Select col2 from table
UNION
Select col3 from table

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM