显示存储过程的数据

时间:2016-08-07 11:29:59

标签: sql-server

adapter = new SimpleCursorAdapter(this,R.layout.listview_items,cursor,
new String[] { "Name" },
new int[] { android.R.id.text1 },
0);

我有4个表(SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [Deal].[USP_LoadDealHistoryByDealId] (@DealId int, @chk int) AS if(@chk = 1) BEGIN SELECT DDT.FieldType AS field, DDT.OldValue as old, DDT.NewValue as new, AU.FullName AS Name, DU.CompanyName As MarchentName , DDT.UpdateOn AS UpdatedOn FROM [Deal].[DealTransaction] as DDT Inner Join AD.Users as AU on AU.UserId =DDT.[UpdateBy] INNER JOIN dbo.UserProfile as DU ON DDT.[UpdateBy]= DU.ProfileID where DDT.dealId=@DealId END ELSE if(@chk=2) BEGIN SELECT 'No Data' as field , 0 as old , 0 as new , AU.FullName AS Name, DU.CompanyName As MarchentName, DD.UpdatedOn AS UpdatedOn FROM AD.Users as AU INNER JOIN [Deal].[Deals] AS DD ON AU.UserId=DD.UploadedBy INNER JOIN dbo.UserProfile as DU ON DD.UploadedBy= DU.ProfileID where DD.dealId=@DealId END Deal.Dealsdeal.DealTransactionAD.User)。我希望在同一列中的两列dbo.UserProfileAU.FullName AS Name和另一列之间进行联合。问题是,如果我搜索交易DU.CompanyName As MarchentName,结果只会ID - 明智但是当我搜索包含UserProfile UserId结果的交易ID时,结果没有来了..有没有加入的问题?

enter image description here

enter image description here

0 个答案:

没有答案