jdbc PreparedStatementを介して2つのselectクエリを実行しています
。クエリはセミコロン(デフォルトの区切り文字)で区切られ
、次のエラーが発生します。
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:SQL構文にエラーがあります。MySQLサーバーのバージョンに対応するマニュアルで、使用する正しい構文を確認してください。
inq.preffered_dateを選択します。.........は2番目のクエリが始まる場所です。
編集->クエリ
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';
一度に2つのクエリを実行することは可能ですか?助けてください。