SQL Querry加入.. !!!! [英] SQL Querry Joining..!!!!
本文介绍了SQL Querry加入.. !!!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,先生,
我在Student_Details表中有名字,姓氏.
我想将这两个字段显示为一个字段.
(例如:Prasad Guduri)
别名全名.
怎么样?
请帮助我..... !!!!
谢谢N问候
Prasad Guduri
Hi Sir,
I have first_name, last_name in table Student_Details.
i want to display those two fields as one field.
(Exapmle: Prasad Guduri )
with alias name Full Name.
How ?
Please help me.....!!!!
Thanks N Regards
Prasad Guduri
推荐答案
您可以连接列并为结果集列定义别名.例如
You can concatenate the columns and define an alias to the result set column. For example
SELECT FirstName + ' ' + LastName AS FullName
FROM YourTable
尝试select first_name + '' '' + last_name as "Full Name" from Student_Details
.
您还可以使用COALESCE
运算符.
Tryselect first_name + '' '' + last_name as "Full Name" from Student_Details
.
You can also use theCOALESCE
operator.
用户隐含像Mika Wendelius一样,如果FirstName为空而LastName具有值,则对iif或case statemend使用隐含运算符....
User concatination Like Mika Wendelius , and if you have FirstName empty and LastName haveing value then use concatination operator with iif or case statemend ....
这篇关于SQL Querry加入.. !!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文