id是主键,用 select * from 表名 where id = 1 就可以了~~~
select * from 表名 where id = 1 and macc_groupId = 2
select* from table where id = 1 union all select * from table where macc_groupId = 2
你这个需求阐述就有点问题,ID应该是该数据表的主键,如果是用ID来查询只有两种情况,一种是能查询出一条数据,另一种是不能查询出数据。
所以针对你的这个需求,只有这样:select * from 表名 where id = 1 and macc_groupId = 2