get values of nested query in mysql -
select *, count(idwallhaswallpost) republish admin_pw.wall_has_wallpost wallpost_idwallpost in (select wallpost_idwallpost wall_has_wallpost wall_idwall in (select wall_idwall follower user_iduser=1)) grouping wallpost_idwallpost having republish>1;
i have nested query in mysql. there anyway acces values nested queries higher in query.
i access wall_idwall in lastly select. select query lowest , see wall_idwall used in operator.
try:
select w.*, count(w.idwallhaswallpost) republish, v.all_wall_idwall admin_pw.wall_has_wallpost w bring together (select h.wallpost_idwallpost, group_concat(distinct h.wall_idwall) all_wall_idwall wall_has_wallpost h bring together follower f on h.wall_idwall = f.wall_idwall , f.user_iduser=1 grouping h.wallpost_idwallpost) v on w.wallpost_idwallpost = v.wallpost_idwallpost grouping wallpost_idwallpost having republish>1;
mysql nested
No comments:
Post a Comment