我通过 jdbc PreparedStatement 触发两个选择查询,
查询由分号(默认分隔符)分隔,
它给了我以下错误
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'select inq.preffered_date as 'dom' , inq.id from assigned_inquiries ai join inqu' 附近使用正确的语法
select inq.preffered_date as .........是第二个查询开始的地方。
编辑-> 查询
select
ms.next_date_of_meeting as 'dom',
ms.inquiry_id as 'id'
from
assigned_inquiries ai,
meeting_status ms
where
ai.representative_id = 1
and (
ai.status = 'postponed'
or ai.status = 'remeeting'
)
and ai.inquiry_id = ms.inquiry_id
and ms.next_date_of_meeting between '2012-1-1' and '2012-12-31'
and ms.created_on = (select max(created_on) from meeting_status where inquiry_id = ms.inquiry_id);
select
inq.preffered_date as 'dom',
inq.id
from
assigned_inquiries ai
join inquiry inq on ai.inquiry_id = inq.id
where
ai.representative_id = 1
and ai.status = 'new'
and inq.preffered_date between '2012-1-1' and '2012-12-31';
是否可以一次执行两个查询。请帮忙。