四则运算如下: --加减乘除(+.-.*.\.%)取余运算 SELECT --加法运算 3+5 AS 加法结果1, 3.5+6 AS 加法结果2, --减法运算 10-2.5 AS 减法结果1, 15.5+5.5 AS 减法结果2, --乘法运算 5*3 AS 乘法结果1, 1.5*2 AS 乘法结果2, --除法运算 25/6 AS 除法结果1, 35*3.5 AS 除法结果2, --取余运算 9%4 AS 取余结果1, 10%5 AS 取余结果2 GO 结果: 比较运算: --比较(>.<
关于Mysql group_concat的应用 ■事先准备: CREATE TABLE TBL_GRP_CAT ( ID INT, VAL CHAR ); INSERT INTO TBL_GRP_CAT VALUES(1, 'a'); INSERT INTO TBL_GRP_CAT VALUES(1, 'b'); INSERT INTO TBL_GRP_CAT VALUES(1, 'c'); INSERT INTO TBL_GRP_CAT VALUES(2, 'd'); INSERT INTO
总结:concat 只能连接两个字符串,|| 可以连接多个 /* CONCAT只能连接两个字符串 The syntax for the concat function is: concat( string1, string2 ) string1 is the first string to concatenate. string2 is the second string to concatenate. */ --||可以连接多个字符串 SQL> select concat('CSDN','_y
String s = null; s += "hello"; System.out.println(s); 结果为:nullhello 原因: 先应用String.valueOf 得出s的value值,再通过StringBuilder拼接hello,因此将value与hello进行了拼接: String s = null; s = (new StringBuilder(String.valueOf(s))).append("hello").toString();