MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
# # In both cases below consider all instances of "a@b" to also sometimes be of the form "a" # # # Case 1: Does not return row in case of "a@b", does work in case of "a" # SELECT `pwd` FROM `accts` WHERE IF ( INSTR('@', 'a@b') != 0, `user` = 'a@b' AND `realm` IS NULL, CONCAT_WS('@', `user`, `realm`) = 'a@b' ) # # Case 2: Gives undefined column error # SELECT `pwd`, CONCAT_WS('@', `user`, `realm`) AS email FROM `accts` WHERE IF ( INSTR('@', 'a@b') != 0, `user` = 'a@b' AND `realm` IS NULL, `email` = 'a@b' )
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|MySQL Error Code||2||31|
|MS Access - need to reduce row size||25||78|
|Update Set Column Query Not Working as Expected||6||46|
|Select Query Fails in PHP but not in TERMINAL Mysql||9||32|
Join the community of 500,000 technology professionals and ask your questions.