MySQL Issue | Subquery returns more than 1 row -
$sql->query('select `p`.`name` `name`, (select `k`.`value` `player_storage` k left join `players` p on `k`.`player_id` = `p`.`id` `k`.`key` = 11000) value `player_storage` k, `players` p `k`.`player_id` = `p`.`id` group `name` order cast(`value` signed) desc limit 0 , 30 ;')
error: subquery returns more 1 row
since have no knowledge in mysql can please me?
i trying take 2 values same column key
= 11000 key
= 11001
as error shows sub-query returning 2 rows against single row in main query, how possible getting error.
you can result below query-
select `p`.`name` `name`, `p`.`skull` `skull`, (select `k`.`value` `player_storage` k left join `players` p on `k`.`player_id` = `p`.`id` `k`.`key` = 11000 limit 1) value `player_storage` k, `players` p `k`.`player_id` = `p`.`id` group `name` order cast(`value` signed) desc limit 0 , 30
note: not sure require same results or else cause of issue.
Comments
Post a Comment