You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Keshava Murthy <ke...@bigtec.org> on 2002/08/30 10:19:03 UTC
code for SQL query
Hi,
Can anybody help me in formulating code for the following sql query using Criteria object-
SELECT
SBT.TAG_ID
FROM
SUB_STN SBT,
CHECK_IN CI
WHERE
SBT.STUDY_ID=CI.STUDY_ID AND
SBT.SUBJECT_ID=CI.SUBJECT_ID AND
CI.STUDY_ID LIKE '"+Studyid+"' AND
CI.PRD_ID LIKE '"+Period+"' AND
SBT.TAG_ID LIKE '"+Station+"%' AND
CI.SUBJECT_ID in (
select CI.SUBJECT_ID
from
CHECK_IN CI,
venflon_insertion_details vi
where
CI.study_id = vi.study_id and
CI.SUBJECT_ID = vi.sub_id and
CI.study_id like '"+Studyid+"')
and
CI.SUBJECT_ID not in (
select
rsw.subject_id
from
CHECK_IN CI,
record_subject_withdrawal rsw
where
CI.study_id = rsw.study_id and
CI.prd_id=rsw.prd_id and
CI.SUBJECT_ID = rsw.subject_id and
CI.study_id like '"+Studyid+"'and
rsw.prd_id='"+Period+"')
regards,
Keshav