示例#1
0
        public void ExceptAllTest()
        {
            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.ExceptAll(s2)).GetCommandText());
            Console.WriteLine(SqlDriver.Compile(s1.ExceptAll(s2).ExceptAll(s3)).GetCommandText());
            Console.WriteLine(SqlDriver.Compile(s1.ExceptAll(s2.ExceptAll(s3))).GetCommandText());
            Console.WriteLine(SqlDriver.Compile(SqlDml.ExceptAll(s1, s2)).GetCommandText());
            Console.WriteLine(SqlDriver.Compile(SqlDml.ExceptAll(s1, s1.ExceptAll(s2))).GetCommandText());
            Console.WriteLine(SqlDriver.Compile(SqlDml.ExceptAll(s1.ExceptAll(s2), s1)).GetCommandText());
            Console.WriteLine(SqlDriver.Compile(SqlDml.ExceptAll(s1.ExceptAll(s2), s1.ExceptAll(s2))).GetCommandText());
        }