buri Posted July 12, 2013 Report Posted July 12, 2013 BIyyas can we write a sql to skip join condition depending upon a flag.. for example if flag is 'Y' the skip a join condition and if flag is 'N' execute the complete sql help pleaseee thanks
gennyfan Posted July 12, 2013 Report Posted July 12, 2013 nee join condition ki flag condition 'AND' cheyu. eg; JOIN table1 ON flag ='N' AND table1.col1=....your other conditions.
mtkr Posted July 12, 2013 Report Posted July 12, 2013 Flag values enni types untaii??? only Y and N a.. or more than tht aa??? if only two aithe or vere values unna just executing or not executing join anukunte ... join condition raasi... where flag = N ( and more flags)... inka vere ante.... help help
BillMarkSteve Posted July 12, 2013 Report Posted July 12, 2013 If flag = y Begin Print ' ' End Else if flag= n Begin Join conditions End Ilaga if else condtions tho code cheyachu simple solution.
BillMarkSteve Posted July 12, 2013 Report Posted July 12, 2013 If flag = y Begin Sql code with out join End Else if flag= n Begin Sql code with join condition End Ilaga if else condtions tho code cheyachu simple solution.
150bryant Posted July 12, 2013 Report Posted July 12, 2013 CASE when Flag = Y then Join when FLag = N then no join end as Col
Recommended Posts