我返回的@ChangeStatus变量为'Y','N',Null 并且需要显示基于该数据的数据,但是该列的字符串与变量不同
declare @ChangeStatus char(1) = 'Y'
select * from Application
where Changes = (case when @ChangeStatus is null then Changes end)
and Changes like (case when @ChangeStatus = 'Y' then '%'end)
and Changes like (case when @ChangeStatus = 'N' then NULL end)
但是没有显示数据
答案 0 :(得分:3)
我怀疑您想使用AND和OR的组合,并在其中添加一些括号,如下所示:
for (int x=0; x<=n; x++){
for (int i=0; i<n-x; i++){
System.out.print(" ");
}
for (int y=1; y<=x; y++){
System.out.print("*");
}
System.out.println();
}
System.out.println("\n4)\n");