Month: December 2016

Are Great Employees Replaceable?

Posted on Updated on

I’ve seen several posts on the web that refer to the original post by Amy Rees Anderson which led me to other posts that plagiarized parts of the article. The links below are what I believe is the original and some others are based on what she wrote. I’ll let you be the judge on who is original and who is taking credit for other people’s ideas.

Great Employees Are Not Replaceable
by Amy Rees Anderson.

Key Employees You Can’t Afford to Lose
by staff editor.

Great Employees Are Not Replaceable by
by Hira Jha.

Best Employee

Good Leaders Are Invaluable To A Company. Bad Leaders Will Destroy It
by Amy Rees Anderson.

SQL Returns Multiple Counters

Posted on Updated on

This SQL can be used to return multiple counters in one record.

select
    (select count(*) from Courses where FacilityId = 4) as counter1,
    (select count(*) from Facilities)                   as counter2,
    (select count(*) from TeeBoxes where CourseId=9)    as counter3,
    (select count(*) from Holes)                        as counter4
Results
+---+----------+----------+----------+----------+
|   | counter1 | counter2 | counter3 | counter4 |
+---+----------+----------+----------+----------+
| 1 | 2        | 4        | 5        | 468      |
+---+----------+----------+----------+----------+

Use the following SQL to return a list of counters.

create table #tempCounters( myCounter int )
insert into #tempCounters( myCounter )
(select count(*) from Courses where FacilityId = 4) 

insert into #tempCounters( myCounter )
 (select count(*) from Facilities)
    
insert into #tempCounters( myCounter )
 (select count(*) from TeeBoxes where CourseId=9)
    
insert into #tempCounters( myCounter )
    (select count(*) from Holes)

select * from #tempCounters
drop table #tempCounters
Results
+---+-----------+
|   | myCounter |
+---+-----------+
| 1 | 2         |
+---+-----------+
| 2 | 4         |
+---+-----------+
| 3 | 5         |
+---+-----------+
| 4 | 468       |
+---+-----------+

Here’s a link to a stackoverflow posting with more examples.