适用场景:对两个集合的处理,例如追加.合并.取相同项.相交项等等. Concat(连接) 说明:连接不同的集合,不会自动过滤相同项:延迟. 1.简单形式: var q = ( from c in db.Customers select c.Phone ).Concat( from c in db.Customers select c.Fax ).Concat( from e in db.Employees select e.HomePhone ); 语句描述:返回所有消费者和雇员的电话和传真.…
一.union与union all 首先建两个view create or replace view test_view_1 as as c from dual union as c from dual union as c from dual ; ----- create or replace view test_view_2 as as c from dual union as c from dual union as c from dual order by a desc, b desc,…
内连接查询 内连接与SqL中inner join一样,即找出两个序列的交集 Model1Container model = new Model1Container(); //内连接 var query = from s in model.Student join c in model.Course on s.CourseCno equals c.Cno select new { ClassID = s.CourseCno, ClassName = c.Cname, Student = new {…
UNION 查询选修了180101号或180102号课程或二者都选修了的学生学号.课程号和成绩. (SELECT 学号, 课程号, 成绩 FROM 学习 WHERE 课程号='180101') UNION (SELECT 学号, 课程号, 成绩 FROM 学习 WHERE 课程号='180102') 与SELECT子句不同,UNION运算自动去除重复.因此,在本例中,若只输出学生的学号,则相同的学号只出现一次.如果想保留所有的重复,则必须用UNION ALL代替UNION,且查询…