SQL subquery returns more than 1 row (1242)
Hey guys.
What's wrong with this line? SELECT a.name, (SELECT points FROM `rcsgo_player` WHERE name = a.name) as points, (SELECT rank FROM `csgo_ranks` WHERE name = a.name) as rank FROM `csgo_clans_applications` a WHERE clan = '%i' ORDER BY rank DESC, points DESC |
Re: SQL subquery returns more than 1 row (1242)
Subqueries need to be limited.
|
Re: SQL subquery returns more than 1 row (1242)
Is the name field unique?
|
Re: SQL subquery returns more than 1 row (1242)
What do you mean limited? So how to make this line right?
|
Re: SQL subquery returns more than 1 row (1242)
Unless you present the table layout, there is no answer.
|
Re: SQL subquery returns more than 1 row (1242)
Quote:
|
Re: SQL subquery returns more than 1 row (1242)
You would not be able to trust the results if more than 1 record is returned since the data should be specific to 1 player so I do not recommend using the LIMIT 1 statement.
Instead of using name, use steam id as this field is unique to a player and you will only get 1 result. Code:
|
| All times are GMT -4. The time now is 13:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.