mysql中关于SELECT *,concat(ItemName,ProductID) as ItemName FROM `t_product`的语句最后的ItemName的值的问题解释
2012-03-06 10:04
405 查看
很多时候都会碰到合并两个字段来作为一个字段的值的情况,如果我们想既要返回所有字段的值,又要让合并后的字段的值被引用到(显示或者其他操作),即是说让合并后的这个字段去代替原来的一个字段,那么怎么做呢?
SELECT *,concat(ItemName,ProductID) as ItemName FROM `t_product`这句话就可以做到的。
但是要注意:合并后的重命名的名称必须是和你要覆盖的字段的名称一致。不然就不可以的。
SELECT *,concat(ItemName,ProductID) as ItemName FROM `t_product`这句话就可以做到的。
但是要注意:合并后的重命名的名称必须是和你要覆盖的字段的名称一致。不然就不可以的。
相关文章推荐
- mysql: "tablename" is marked as crashed and should be repaired修复 问题分析: 当mysql出现这类提示时,大部分的现象为查询不到正常的
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于mysql启动问题---mysqld_safe mysqld from pid file * ended
- 关于MySQL问题:can't get hostname for your address
- 【转】关于使用Android6.0编译程序时,出现getSlotFromBufferLocked: unknown buffer: 0xac0f8650问题的解释
- 关于oracle sql语句查询时 表名和字段名要加双引號的问题具体解释
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于在myeclipse中执行mySQL语句出现问题
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于配置MySQL语句长度限制的问题
- 关于mysql重新安装最后一步的相关问题解决
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于Sql关键字SELECT FROM GROUP ORDER 等的执行顺序问题的解释
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- 关于MYSQL:Got error 134 from storage engine/is marked as crashed and should be repaired
- mysql中select column_name from Information_schema.columns where table_Name = 'test'出现多个字段的问题