开发者

Seggregating the output of a query

My question might seem weird. But I need to know whether we can identify and seggregate the rows fetched from particular table in a query, which is formed by joining tables.

Please refer the below query if I am you are not clear with开发者_运维知识库 my question.

My requirement is to know the rows fetched from table 'rel' alone in the query.

SELECT rel.*
FROM rel,  C
WHERE rel.col1  = C.col1
AND C.col1 NOT IN (SELECT R.col1 FROM R WHERE R.col2 = 'MN')
AND rel.col2= 'MN'
AND rel.col3= 'MN'
AND c.col2  ='MN';

Thanks, Savitha


Since you are performing an INNER JOIN by using the comparison in the WHERE clause, all your records, by definition, are coming from the rel table.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜