我需要做一些mysql查询,但我宁愿在1个查询中获取所需的所有数据而不是多个。
如何将其转换为子查询?
SELECT * FROM categories ORDER BY categoryName ASC
SELECT * FROM locations ORDER BY locationName ASC
答案 0 :(得分:0)
试试这个......
SELECT * FROM categories,(SELECT * FROM locations ORDER BY locationName ASC) AS location ORDER BY categoryName ASC