开发者

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 :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜