查询,获取结果 再次查询 [英] make a query, get results make query again
本文介绍了查询,获取结果 再次查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在一条语句中执行这些查询:- How TO ??
i want to execute these queries in a single statement :- How TO ??
SELECT count(id) as levela FROM `member` where parent_id in (SELECT id FROM `member` where parent_id in (SELECT id FROM `member` where parent_id = 2 ))
SELECT count(id) as levelb FROM `member` where parent_id in (SELECT id FROM `member` where parent_id = 2)
SELECT count(id) as levelb FROM `member` where parent_id = 2
推荐答案
改为使用 'where'、'where in' - where in 允许您在数组中进行 serach.例如:
Use instead 'where', 'where in' - where in allows You to serach in array. for example :
Select id from member where parent_id IN (here array ($y) )
这篇关于查询,获取结果 再次查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文