I’m doing something wrong but I just can’t figure out what it is.
I have a query that i’m running, and it works perfect, but when i go to add in the ability to grab the url_title from exp_channel_titles the results it returns are all wonky.
here is a sample of the working query:
SELECT DISTINCT
(exp_channel_data.channel_id),
exp_channel_data.field_id_1 AS first_name,
exp_channel_data.field_id_2 AS last_name,
exp_channel_data.field_id_3 AS school,
exp_channel_data.field_id_4 AS academic_year,
exp_channel_data.field_id_5 AS subject_of_study
FROM exp_channel_data
LEFT JOIN exp_channel_titles
ON (exp_channel_data.channel_id = exp_channel_titles.channel_id)
WHERE exp_channel_titles.channel_id='2'
ORDER BY exp_channel_data.field_id_2
ASC
LIMIT 30
OFFSET 0But it doesn’t work if I try to grab the URL title.
SELECT DISTINCT
(exp_channel_data.channel_id),
exp_channel_titles.url_title,
exp_channel_data.field_id_1 AS first_name,
exp_channel_data.field_id_2 AS last_name,
exp_channel_data.field_id_3 AS school,
exp_channel_data.field_id_4 AS academic_year,
exp_channel_data.field_id_5 AS subject_of_study
FROM exp_channel_data
LEFT JOIN exp_channel_titles
ON (exp_channel_data.channel_id = exp_channel_titles.channel_id)
WHERE exp_channel_titles.channel_id='2'
ORDER BY exp_channel_data.field_id_2
ASC
LIMIT 30
OFFSET 0I know it’s probably something stupid. Any help would be appreciated.