Posting from the Informix-list
Posted in 2004
--0-1011526614-1096280701=:51977 Content-Type: text/plain; charset=us-ascii Any better ways to re write this query . SELECT ch.ch_rec_key, ch.ch_ctry_hol_lk, ch.cal_calendar_dt, co.co_ctry_cd, op.op_type_cd, ch.ch_name, ch.ch_remarks, ch.ch_rec_effect_dt, ch.ch_rec_expiry_dt, ch.ch_chg_timestamp FROM country_holiday ch, country co, op_type op WHERE ch.op_type_lk = op.op_type_lk AND ch.co_ctry_lk = co.co_ctry_lk AND co.co_ctry_cd = ? AND ch.cal_calendar_dt = ? AND ( ( ch.ch_rec_effect_dt <= ? AND ch.ch_rec_expiry_dt >= ? ) OR ( ch.ch_rec_effect_dt <= ? AND ch.ch_rec_expiry_dt is null ) ) AND ( ( co.co_rec_effect_dt <= ? AND co.co_rec_expiry_dt >= ? ) OR ( co.co_rec_effect_dt <= ? AND co.co_rec_expiry_dt is null ) ) AND ( ( op.op_rec_effect_dt <= ? AND op.op_rec_expiry_dt >= ? ) OR ( op.op_rec_effect_dt <= ? AND op.op_rec_expiry_dt is null ) ) Thanks Deena --------------------------------- Do you Yahoo!? vote.yahoo.com - Register online to vote today! --0-1011526614-1096280701=:51977 Content-Type: text/html; charset=us-ascii <DIV> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'">Any better ways to re write this query .</SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"></SPAN> </P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"></SPAN> </P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'">SELECT<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_rec_key,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_ctry_hol_lk,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt 1in; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.cal_calendar_dt,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>co.co_ctry_cd,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>op.op_type_cd,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_name,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_remarks,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_rec_effect_dt,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_rec_expiry_dt,<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.ch_chg_timestamp<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'">FROM<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>country_holiday ch, country co, op_type op<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'">WHERE<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.op_type_lk = op.op_type_lk AND<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"> </SPAN>ch.co_ctry_lk = co.co_ctry_lk AND<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none