creating a join alias - how to?
I'm wanting to do something like
SELECT
t.subtitle
FROM
temp t
LEFT JOIN ep e ON e.subtitle=t.subtitle AND e.episode=t.episode AS se
WHERE se IS NULL
GRO开发者_如何学运维UP BY t.subtitle, t.episode;
So that the where clause can refer to the result of the left join, is this possible or do I have to use a different method? (episode and subtitle are indexed in both tables)
Thanks, Paul
UPDATE When I say result I mean the left table returns no matches for e.subtitle=t.subtitle and e.episode=t.episode
Do I have to instead do
SELECT
t.subtitle
FROM
temp t
LEFT JOIN ep e ON e.subtitle=t.subtitle AND e.episode=t.episode
WHERE e.subtitle IS NULL AND e.episode IS NULL
GROUP BY t.subtitle, t.episode;
Yes, you'll have to do that second query for the result :)
精彩评论