日期:2014-05-17  浏览次数:20941 次

ora 丢失右括号
select * from ( select distinct * from ( select ctm.id_ ctmId , ctm.name_ ctmName , ctr.id_ ctrId , ctr.name_ ctrName , ctr.email_ ctrEmail , ctr.mphone_ ctrMphone , ctr.brithday_ ctrBrithday from contacter_ ctr inner join customer_ ctm on ctr.fk_customer_ = ctm.id_ inner join user_ u on ctm.fk_user_ = u.id_ inner join ctm_ctg_lk_ ctmCtg on ctmCtg.fk_ctm_ = ctm.id_ inner join ctm_ctg_ cc on ctmCtg.fk_ctm_ctg_ = cc.id_ where ctr.brithday_ like '%-04-12' and u.id_ in '5dfaf039298290ee0129d51355e5029e' regexp_like( ctr.mphone_ , '^((13[0-9])|(15[^4,\D])|(18[0,5-9]))\d{8}$' ) ) order by ctmId asc )where rownum <= ?


高手来帮忙看看这是怎么回事


------解决方案--------------------
SQL code

select *
  from (select distinct *
          from (select ctm.id_       ctmId,
                       ctm.name_     ctmName,
                       ctr.id_       ctrId,
                       ctr.name_     ctrName,
                       ctr.email_    ctrEmail,
                       ctr.mphone_   ctrMphone,
                       ctr.brithday_ ctrBrithday
                  from contacter_ ctr
                 inner join customer_ ctm
                    on ctr.fk_customer_ = ctm.id_
                 inner join user_ u
                    on ctm.fk_user_ = u.id_
                 inner join ctm_ctg_lk_ ctmCtg
                    on ctmCtg.fk_ctm_ = ctm.id_
                 inner join ctm_ctg_ cc
                    on ctmCtg.fk_ctm_ctg_ = cc.id_
                 where ctr.brithday_ like '%-04-12'
                   and u.id_ in ('5dfaf039298290ee0129d51355e5029e',
                 regexp_like(ctr.mphone_,
                                   '^((13[0-9])|(15[^4,\D])|(18[0,5-9]))\d{8}$')))
         order by ctmId asc)
 where rownum <=?

------解决方案--------------------
SQL code

select *
  from (select distinct *
          from (select ctm.id_       ctmId,
                       ctm.name_     ctmName,
                       ctr.id_       ctrId,
                       ctr.name_     ctrName,
                       ctr.email_    ctrEmail,
                       ctr.mphone_   ctrMphone,
                       ctr.brithday_ ctrBrithday
                  from contacter_ ctr
                 inner join customer_ ctm
                    on ctr.fk_customer_ = ctm.id_
                 inner join user_ u
                    on ctm.fk_user_ = u.id_
                 inner join ctm_ctg_lk_ ctmCtg
                    on ctmCtg.fk_ctm_ = ctm.id_
                 inner join ctm_ctg_ cc
                    on ctmCtg.fk_ctm_ctg_ = cc.id_
                 where ctr.brithday_ like '%-04-12'
                   and u.id_ in ('5dfaf039298290ee0129d51355e5029e',
                 regexp_like(ctr.mphone_,
                                   '^((13[0-9])|(15[^4,\D])|(18[0,5-9]))\d{8}$')))
         order by ctmId asc)
 where rownum <=?

------解决方案--------------------
SQL code

select *
  from (select distinct *
          from (select ctm.id_       ctmId,
                       ctm.name_     ctmName,
                       ctr.id_       ctrId,
                       ctr.name_     ctrName,
                       ctr.email_    ctrEmail,
                       ctr.mphone_   ctrMphone,
                       ctr.brithday_ ctrBrithday
                  from contacter_ ctr
                 inner join customer_ ctm on ctr.fk_customer_ = ctm.id_
                 inner join user_ u on ctm.fk_user_ = u.id_
                 inner join ctm_ctg_lk_ ctmCtg on ctmCtg.fk_ctm_ = ctm.id_
                 inner join ctm_ctg_ cc on ctmCtg.fk_ctm_ctg_ = cc.id_
                 where ctr.brithday_ like '%-04-12'
                   and u.id_ = '5dfaf039298290ee0129d51355e5029e' --这个直接用=号
                   and regexp_like(ctr.mphone_, --前面加个and关系符
                                   '^