我的查询效果很好,但CONCAT_GROUP()
的结果比我想要的还多。
查询:
SELECT GROUP_CONCAT(parent.place_name) AS place_name
FROM address AS node,
address AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
GROUP BY node.id
ORDER BY node.lft"
address
表:
------------------------------------
id | place_name | lft | rgt
~-----------------------------------
1 | A | 1 | 4
~-----------------------------------
2 | B | 2 | 3
~-----------------------------------
place_name
的结果将是:
A
A, B
但我需要它:
A
B, A
我尝试使用ORDER
,但我未能做到正确。你能帮帮我吗?
答案 0 :(得分:0)
请参阅this link
中的第3个示例LayoutInflater inflater = getLayoutInflater();
View dialoglayout = inflater.inflate(R.layout.dialog_layout, (ViewGroup) getCurrentFocus());
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(dialoglayout);
builder.show();