简体   繁体   English

从3列获取DISTINCT值

[英]Getting DISTINCT values from 3 columns

I have 1 single table with 3 columns say col1,col2,col3 我有3个列的1个单一表格,说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 ? 要获取要在html下拉框中填充的独特列表(即,我想要a,b,c,d,e),按字母顺序排列?

Pseudocode: 伪代码:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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