我有
country,theOrderColumn1country,theOrderColumn2我想country从这两个SELECT语句加入DISTINCT :
SELECT DISTINCT `country` FROM `table1` ORDER BY `theOrderColumn1`
Run Code Online (Sandbox Code Playgroud)
和
SELECT DISTINCT `country` FROM `table2` ORDER BY `theOrderColumn2`
Run Code Online (Sandbox Code Playgroud)
例:
table1 (country, theOrderColumn1): (uk, 1), (usa, 2)
table2 (country, theOrderColumn2): (france, 1), (uk, 2)
我想要这个结果:
france
uk
usa
Run Code Online (Sandbox Code Playgroud) 我需要得到简单的javascript abject的真实顺序,但我从这段代码得到错误的答案:
var Obj={"x":"z", "2":"a", "1":"b"};
for(i in Obj)
document.write(Obj[i]+"<br>");
Run Code Online (Sandbox Code Playgroud)
我希望看到z,a,b的答案,但我得到b,a,z
见行动代码:
http://jsfiddle.net/gpP7m/