public void IntersectTest() { SqlSelect s1 = SqlDml.Select(SqlDml.TableRef(Catalog.Schemas["main"].Tables["track"])); s1.Columns.Add(SqlDml.Asterisk); SqlSelect s2 = SqlDml.Select(SqlDml.TableRef(Catalog.Schemas["main"].Tables["track"])); s2.Columns.Add(SqlDml.Asterisk); SqlSelect s3 = SqlDml.Select(SqlDml.TableRef(Catalog.Schemas["main"].Tables["track"])); s3.Columns.Add(SqlDml.Asterisk); Console.WriteLine(sqlDriver.Compile(s1.Intersect(s2)).GetCommandText()); Console.WriteLine(sqlDriver.Compile(s1.Intersect(s2).Intersect(s3)).GetCommandText()); Console.WriteLine(sqlDriver.Compile(s1.Intersect(s2.Intersect(s3))).GetCommandText()); Console.WriteLine(sqlDriver.Compile(SqlDml.Intersect(s1, s2)).GetCommandText()); Console.WriteLine(sqlDriver.Compile(SqlDml.Intersect(s1, s1.Intersect(s2))).GetCommandText()); Console.WriteLine(sqlDriver.Compile(SqlDml.Intersect(s1.Intersect(s2), s1)).GetCommandText()); Console.WriteLine(sqlDriver.Compile(SqlDml.Intersect(s1.Intersect(s2), s1.Intersect(s2))).GetCommandText()); }
public void IntersectTest() //TODO: Relook into the keyword for INTERSECT { SqlSelect s1 = SqlDml.Select(SqlDml.TableRef(Catalog.DefaultSchema.Tables["address"])); s1.Columns.Add(SqlDml.Asterisk); SqlSelect s2 = SqlDml.Select(SqlDml.TableRef(Catalog.DefaultSchema.Tables["address"])); s2.Columns.Add(SqlDml.Asterisk); SqlSelect s3 = SqlDml.Select(SqlDml.TableRef(Catalog.DefaultSchema.Tables["address"])); s3.Columns.Add(SqlDml.Asterisk); Console.WriteLine(SqlDriver.Compile(s1.Intersect(s2)).GetCommandText()); Console.WriteLine(SqlDriver.Compile(s1.Intersect(s2).Intersect(s3)).GetCommandText()); Console.WriteLine(SqlDriver.Compile(s1.Intersect(s2.Intersect(s3))).GetCommandText()); Console.WriteLine(SqlDriver.Compile(SqlDml.Intersect(s1, s2)).GetCommandText()); Console.WriteLine(SqlDriver.Compile(SqlDml.Intersect(s1, s1.Intersect(s2))).GetCommandText()); Console.WriteLine(SqlDriver.Compile(SqlDml.Intersect(s1.Intersect(s2), s1)).GetCommandText()); Console.WriteLine(SqlDriver.Compile(SqlDml.Intersect(s1.Intersect(s2), s1.Intersect(s2))).GetCommandText()); }