我想获得第三列类似值的单列。这是我现在的询问。我怎么能得到这个
8 31-Jul-2015 10:02 AM 77
8 31-Jul-2015 11:24 AM 77
8 01/Aug/2015 11:04 AM 79
8 03/Aug/2015 10:12 AM 80
8 03/Aug/2015 12:25 PM 80
8 21/Aug/2015 04:32 PM 83
8 22/Aug/2015 05:39 PM 85
8 24/Aug/2015 09:56 AM 86
8 24/Aug/2015 09:59 AM 86
8 24/Aug/2015 09:59 AM 86
我的查询是
@employeeId int=8,
@datefrom date=null,
@dateto date=null
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--Insert statements for procedure here
select
x.employee_Id,
x.punchin,
x.attendanceMasterId
from
(
select atin.punchin,inam.employee_Id,atin.attendanceMasterId
from dbo.tblAttendanceDetails atin
left join dbo.tblAttendanceMaster inam on inam.record_Id=atin.attendanceMasterId
left join tblEmployeeJobDetails ejd on ejd.recordId=inam.employee_Id
where ((isnull(@employeeId,0)=0 or ejd.recordId=@employeeId))
) x
END
答案 0 :(得分:0)
您可以通过连接所有三列来实现此目的,如: -
select (cast(column1 as varchar) +' '+
cast(column2 as varchar)+' '+cast(column3 as varchar))
as '' from table_name