Skip to content
Advertisement

Tag: subquery

Replace subquery with join for the same table

Can the expected result in this case be accomplished without a subquery ? Maybe using a join ? We have a name say ‘jose’, Expected result is all rows which has same color as jose. Query should run in both MS-SQL and ORACLE. http://sqlfiddle.com/#!18/5f7e3/2 Answer You can get this result with a JOIN, by self-joining on the color field, where

Advertisement