Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[COLOR=blue]DECLARE[/color] @Test [COLOR=blue]TABLE[/color] (C_ID [COLOR=blue]int[/color], [COLOR=blue]Cost[/color] [COLOR=blue]int[/color], Is_employee [COLOR=blue]varchar[/color](10))
[COLOR=blue]INSERT[/color] [COLOR=blue]INTO[/color] @Test [COLOR=blue]VALUES[/color] (100, 234,[COLOR=red]'True'[/color])
[COLOR=blue]INSERT[/color] [COLOR=blue]INTO[/color] @Test [COLOR=blue]VALUES[/color] (134, -587,[COLOR=red]'False'[/color])
[COLOR=blue]INSERT[/color] [COLOR=blue]INTO[/color] @Test [COLOR=blue]VALUES[/color] (120, 457,[COLOR=red]'True'[/color])
[COLOR=blue]INSERT[/color] [COLOR=blue]INTO[/color] @Test [COLOR=blue]VALUES[/color] (135, -1,[COLOR=red]'True'[/color])
[COLOR=blue]SELECT[/color] Test.*
[COLOR=blue]FROM[/color] @Test Test
[COLOR=blue]INNER[/color] [COLOR=blue]JOIN[/color] ([COLOR=blue]SELECT[/color] [COLOR=#FF00FF]MIN[/color]([COLOR=blue]CASE[/color] [COLOR=blue]WHEN[/color] [COLOR=blue]Cost[/color] < 0 [COLOR=blue]THEN[/color] 9999999 [COLOR=blue]ELSE[/color] [COLOR=blue]Cost[/color] [COLOR=blue]END[/color]) [COLOR=blue]AS[/color] [COLOR=blue]Cost[/color]
[COLOR=blue]FROM[/color] @Test
[COLOR=blue]WHERE[/color] Is_employee = [COLOR=red]'True'[/color]) tst
[COLOR=blue]ON[/color] Test.Cost = Tst.Cost
[COLOR=blue]WHERE[/color] Test.Is_employee = [COLOR=red]'True'[/color]
CASE WHEN Cost < 0 THEN [!]NULL[/!] ELSE Cost END