根据你写的代码看,你是否想从表1当中查询出在表2当中具有条件date_id='xxxx-xx-xx'的记录?如果是的话,可以使用两种方法: 1、内连接 select a.字段1,a.字段2 from 表1 a,表2 b; where a.date_id=b.date_id and b.a.date_id='xxxx-xx-xx' 2、左连接 select a.字段1,a.字段2 from 表1 a left join 表2 b; on a.date_id=b.date_id and b.a.date_id='xxxx-xx-xx' 3、嵌套查询 select 字段1,字段2 from 表1; where date_id in (select date_id from 表2 date_id='xxxx-xx-xx')