我有以下查詢:如何替換SQL中的不同出現?
Select PERSON_NAME, Mobile_Nr, replace(Message, 'text 8' ,'yes') as SMSs from PERSON a
inner join USER_MOBILE b on a.ID_PERSON=b.ID_USER
inner join MOBILE_NUMBER c on b.ID_MOBILE=C.ID
inner join MESSAGE_ID d on c.ID=d.ID_Mobile
where a.Person_Name not in
(Select PERSON_NAME from PERSON a
inner join USER_MOBILE b on a.ID_PERSON=b.ID_USER
inner join MOBILE_NUMBER c on b.ID_MOBILE=C.ID
inner join CALL_ID d on c.ID=d.ID_Mobile)
它返回:
PERSON_NAME Mobile_Nr SMSs
First name 5 Last name 5 797900012 yes
First name 5 Last name 5 797900012 text 9
First name 5 Last name 5 797900016 text 13
我怎樣才能改變所有的值在短信到是在我的查詢?
什麼表是'消息'列? –
它在Message_ID – jaji18
什麼時候該查詢返回的值不是'yes'? – geoand