In Oracle, there are three kinds of equals: <>,!=,^=
For example:
SELECT * FROM test where name<> ' xn '. The returned result is a record where name is not xn and name is not empty. But this is not the same as what we want to get, because our goal is to get all the records of name Xn, and of course this includes a record with the name empty, so these write SQL statements are problematic. In order to solve this problem, we can use the following two kinds of scenarios:
SELECT * FROM Test where InStr (concat (name, ' xx '), ' xn ') = 0; select * FROM Test where NVL (name, ' xx ') <> ' xn ';
Note: null can only be judged by IS null or is not NULL, and other operators and null operations are false.
String connection methods in each database
1) Mysql:concat ()
2) Oracle:concat (), | |
3) SQL Server: +
For example:
SELECT ' This is ' + ' a test '; The return value of this a testselect CONCAT ("This is", ' a Test ') from dual; Return value This a testselect ' this is ' | | ' A test ' from dual; Return value this a testCategory: ORACLE
Strange "no equals" in Oracle