Question
SQL problem
Hi there,
I'm trying to display vacancies which have applications that have an interview status of 1. The problem is its displaying duplicate listings based on the number of applications per vacancy. E.G if a vacancy has 3 applications then it shows the vacancy 3 times, where I just want to show it once. I tried using distinct in the query but it didnt seem to change it.
select distinct(vacancyId), v.id as VACID, title, clientId, v.status, c.id, c.companyname, candVacDate as THEDATE, c.county, c.town, adminID, v.location, interview
from vacancies as v
inner join clients as c
on (v.clientId = c.id)
inner join candVac as cv
on (v.id = cv.vacancyId)
where interview = 1;
I've probably missed something, don't hesitate to ask for more info!
Any help is appreciated.
Cheers - Jared.
I'm trying to display vacancies which have applications that have an interview status of 1. The problem is its displaying duplicate listings based on the number of applications per vacancy. E.G if a vacancy has 3 applications then it shows the vacancy 3 times, where I just want to show it once. I tried using distinct in the query but it didnt seem to change it.
select distinct(vacancyId), v.id as VACID, title, clientId, v.status, c.id, c.companyname, candVacDate as THEDATE, c.county, c.town, adminID, v.location, interview
from vacancies as v
inner join clients as c
on (v.clientId = c.id)
inner join candVac as cv
on (v.id = cv.vacancyId)
where interview = 1;
I've probably missed something, don't hesitate to ask for more info!
Any help is appreciated.
Cheers - Jared.