i have this query,
$sql = "
select
old_team_id
from
transfers
where
player_id = $player_id and
transferid = latest_transfer_id
";
i have a table called transfers, in my table there is transferid field, what I want is when I run the query, it will select the old_team_id from transfers table where the transferid is the latest transferid. will that be possible? if yes, what do i lack on my query. thanks.
To get the value in the row with the largest
transferidyou can useORDER BYandLIMIT: