Friday 18 July 2014

Search data from sql database All data and with condition using single query


//Sql Query

declare @tt int
set @tt=0
select * from mstCombobox_T where (@tt<>0 and Flag=@tt) or (Flag<>0 and @tt=0)

//Output


declare @tt int
set @tt=12
select * from mstCombobox_T where (@tt<>0 and Flag=@tt) or (Flag<>0 and @tt=0)


//Output


No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...