使用subQuery作为数组的MySQL Query

时间:2013-02-05 03:47:59

标签: mysql arrays subquery

我需要做一些mysql查询,但我宁愿在1个查询中获取所需的所有数据而不是多个。

如何将其转换为子查询?

SELECT * FROM categories ORDER BY categoryName ASC
SELECT * FROM locations ORDER BY locationName ASC

1 个答案:

答案 0 :(得分:0)

试试这个......

SELECT * FROM categories,(SELECT * FROM locations ORDER BY locationName ASC) AS location ORDER BY categoryName ASC