oracle - How to use two LIKE conditions? -


i need find students , m in first name not have , m in last name. query reason keeps displaying last names have m's... doing wrong?

select (firstname || ' ' || lastname) "fullname"   a5  lower(firstname) '%a%m%'     , lower(lastname) not '%a%m%' order lastname,          firstname 

where clause should be:

where (lower(firstname) '%a%m%' or lower(firstname) '%m%a%') , lower(lastname) not '%a%' , lower(lastname) not '%m%' 

you including cases firstname had followed by m. similarly, excluding cases lastname had both , m, comes before m.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -