Query Analasys--below queries give the same result or not

General
Enthusiast

Query Analasys--below queries give the same result or not

locking row for access

(select a.xxxsubsno,

a.otherprtyno,

dtstrtchrg  ,

timeofchrg ,

a.chargedurn,

(coalesce(A.first_mcc,'')||'_'||coalesce(A.first_mnc,''))||'_'||coalesce(A.ORIGLOCNNO,'')||'_'||coalesce(A.CELLIDFIRSTCELL,'')

CELLIDFIRSTCELL,

(coalesce(A.last_mcc,'')||'_'||coalesce(A.last_mnc,''))||'_'||coalesce(A.TRMLOCNNO,'')||'_'||coalesce(A.CELLIDLASTCELL,'')

 CELLIDLASTCELL,

a.cdrtype,

a.xxsubsimei,

a.xxsubsimsi,

a.SUBSCRIPTIONTYPE ,

a.SMSCENTERNO,

a.MSCID

from sa_prod.MH_BH_ICR_CUR a

where a.plmnid='IND24'

and  dtstrtchrg between  '2010-05-08' and '2010-05-10'

and cdrtype in ('MOC','MTC','SMMO','SMMT') and

 (a.cellidfirstcell in('30161','30162','30163') or

a.CELLIDLASTCELL in('30161','30162','30163')

 )

---and ( cast((timeofchrg (format ' HH:MI:SS')) as char(10)) >=('00:00:01')--commemted

---and cast((timeofchrg (format ' HH:MI:SS')) as char(10)) <=('23:59:59'))--commented

and a.ORIGLOCNNO='157' ---- to use only when specified in email

)

QUERY2:

locking row for access

(select a.xxxsubsno,

a.otherprtyno,

dtstrtchrg  ,

timeofchrg ,

a.chargedurn,

(coalesce(A.first_mcc,'')||'_'||coalesce(A.first_mnc,''))||'_'||coalesce(A.ORIGLOCNNO,'')||'_'||coalesce(A.CELLIDFIRSTCELL,'')

CELLIDFIRSTCELL,

(coalesce(A.last_mcc,'')||'_'||coalesce(A.last_mnc,''))||'_'||coalesce(A.TRMLOCNNO,'')||'_'||coalesce(A.CELLIDLASTCELL,'')

 CELLIDLASTCELL,

a.cdrtype,

a.xxsubsimei,

a.xxsubsimsi,

a.SUBSCRIPTIONTYPE ,

a.SMSCENTERNO,

a.MSCID

from sa_prod.MH_BH_ICR_CUR a

where a.plmnid='IND24'

and  dtstrtchrg between  '2010-05-08' and '2010-05-10'

and cdrtype in ('MOC','MTC','SMMO','SMMT') and

 (a.cellidfirstcell in('30161','30162','30163') or

a.CELLIDLASTCELL in('30161','30162','30163')

 )

and ( cast((timeofchrg (format ' HH:MI:SS')) as char(10)) >=('00:00:01')

and cast((timeofchrg (format ' HH:MI:SS')) as char(10)) <=('23:59:59'))

and a.ORIGLOCNNO='157' ---- to use only when specified in email

)

Note: I want to load date from 08/05/2010  time 00.00 to 10/05/2010 time 24.00