DISTINCT is not a function, it applies to all the columns in the SELECT
where did you learn to use it like a function? you aren't the first to do that, and i wish i could find whichever book or website tutorial is teaching this, because it's just flat out wrong
Code:
select campaign.id
, data.id
, data.location
from campaign
inner
join data
on data.campaign = campaign.id
and data.id =
( select min(id)
from data
where campaign = campaign.id )
where campaign.region = 0
order
by campaign.id limit 4
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --