日期:2014-05-17  浏览次数:20582 次

SQL语句不会写 求大神帮忙.在线等.....
表A                                    表B

Id  Name   Remark                      Id  AId  State
1   张山     无                        1    1   true
2   王二     无                        2    1   false
3   李四     无                        3    1   false
                                       4    2   true
                                       5    2   true
                                       6    3   false
                                       7    3   true

我想查询 表B 状态全部为true 的表A数据

结果:  ID     Name     Remark
        2      王二       无







------解决方案--------------------
create table 表A(Id int, Name  varchar(10),  Remark varchar(10))  

insert into 表A
select 1   ,'张山'     ,'无' union all            &n