Using case in a sql select statement
问题 Consider a table with a column amount, Amount -1235.235 1356.45 -133.25 4565.50 5023 -8791.25 I want to my result pane to be like this, Debit Credit 0 -1235.235 1356.45 0 0 -133.25 Here is my stored procedure, USE [HotelBI_CustomDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[SP_GetJVReport]( @p_FromDate datetime, @p_ToDate datetime ) AS BEGIN select jv.AccountNo,jv.AccountNoTitle,(select JV_GroupsHead.GroupTitle from JV_GroupsHead where JV_GroupsHead.Id=jv