Skip to content

If else using case for returning value

I am trying to do an if else statement using CASE. If no records, then make it 0 then +1. Or else, just take the last record then +1. At first try i used ISNULL(statement,0). But it doesn’t have else …

Understanding where clause vs join

Can somebody explain the difference between below query examples. select column1,column2 from table1 join table2 on table1.columna = table2.columna and columna=’1234′ vs select column1,…

Sql agent job last run status

I have N jobs with M steps in each, that could change any time(Add/delete some steps). Jobs have different schedule to run. I want a query to get last run status, job id, job name of each job. Is it …