[size=medium]
以前用Oracle的时候,字符串拼接用 | ,今天在mysql上试试发现不行,用 || 也不行,因为一般数据库对 || 的支持还是很不错的,经过查找mysql帮助手册,发现mysql中的字符串拼接使用的是concat函数,如
[color=red]在mysql中 || 的意思是or的意思。[/color]
[/size]
以前用Oracle的时候,字符串拼接用 | ,今天在mysql上试试发现不行,用 || 也不行,因为一般数据库对 || 的支持还是很不错的,经过查找mysql帮助手册,发现mysql中的字符串拼接使用的是concat函数,如
mysql> select concat(prod_name,prod_price)
from products;
+------------------------------+
| concat(prod_name,prod_price) |
+------------------------------+
| Fish bean bag toy3.49 |
| Bird bean bag toy3.49 |
| Rabbit bean bag toy3.49 |
| 8 inch teddy bear5.99 |
| 12 inch teddy bear8.99 |
| 18 inch teddy bear11.99 |
| Raggedy Ann4.99 |
| King doll9.49 |
| Queen doll9.49 |
+------------------------------+
[color=red]在mysql中 || 的意思是or的意思。[/color]
[/size]