mysql> SELECT SUM(b'1100'), SUM(DISTINCT b'1100');+--------------+-----------------------+| sum(b'1100') | sum(DISTINCT b'1100') |+--------------+-----------------------+|12 |9 |+--------------+-----------------------+
let result = session.runSql("SELECT * FROM t")
for (let row of result) {
console.log(row.c1+row.c3);
}
mysql> CREATE VIEW v1 AS SELECT c1, c3 FROM t1;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE VIEW v1 AS SELECT c2 FROM t1;
ERROR 1050 (42S01): Table 'v1' already exists
mysql> CREATE VIEW IF NOT EXISTS v1 AS SELECT c2 FROM t1;
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> SHOW WARNINGS;
+-------+------+---------------------------+
| Level | Code | Message|
+-------+------+---------------------------+
| Note | 1050 | Table 'v1' already exists |
+-------+------+---------------------------+
1 row in set (0.00 sec)
mysql> SHOW CREATE VIEW v1\G
*************************** 1. row ***************************
View: v1
Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`vuser`@`loca
lhost` SQL
SECURITY DEFINER VIEW `v1` AS select `t1`.`c1` AS `c1`,`t1`.`c3` AS `c
3` from `t1`
character_set_client: utf8mb4
collation_connection: utf8mb4_0900_ai_ci
1 row in set (0.00 sec)
"[1 ,2]"
"[1,2 ]"
" [1,2]"
"[1,2] "
整理作者介绍
徐轶韬,MySQL解决方案首席工程师。为中国金融、政府、航空运输等行业的MySQL用户提供相关产品的售前咨询,企业级产品介绍服务以及推广和普及MySQL数据库在社区的使用。公众号“MySQL解决方案工程师”运营者和内容作者。
如果字段的最大可能长度超过255字节,那么长度值可能…
只能说作者太用心了,优秀
感谢详解
一般干个7-8年(即30岁左右),能做到年入40w-50w;有…
230721