SQL语句:将3列条目合并为一列 [英] SQL Statement: Combine 3 column entry into one column

查看:203
本文介绍了SQL语句:将3列条目合并为一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例:

给出的:
高度= 5
宽度= 7
单位=英尺

答:
字段名称尺寸= 5 x 7英尺

Example:

Given:
height = 5
width = 7
unit = feet

Answer:
Fieldname dimension = 5 x 7 feet

推荐答案

我认为这对您有帮助
i think this will help you
Select Cast(height as varchar(20)) + ' X ' + Cast(width as varchar(20)) + ' ' + unit from [Tablename]



还在问这个问题之前.请先搜索它,然后提出问题.



also before asking the question. please search it first then ask the question.


使用此查询

use this query

Select convert(varchar(20) , height  ) + ' x ' + convert(varchar(20) ,width ) + ' ' + unit from UrTable


这篇关于SQL语句:将3列条目合并为一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆