Tags » SQL Query

Find the Employee with the 2nd Highest Salary

SELECT EmployeeId, Salary
Select EmployeeId, Salary, ROW_NUMBER() OVER(Order by Salary Desc) as Salary_Order
from Employee
) DT
WHERE DT. Salary_Order = 2 ; 20 more words


Using SQL Snapshot backups along with Availability group

Snapshot backup is beautiful option during releases and deploying changes
specially when the database size is large like few hundreds of GBs. We have a practice to take snapshot backup during the release and delete once testing is completed on a 600+GB database. 159 more words


SQL Tricks: fetch numeric value from a varchar field

Description: if a column (field) of your table has varchar datatype and that field is containing both numeric and character data, if you want to fetch only numeric data , use below query: 8 more words


How to give access to Users in Secondary Always-On/Mirror Server

When we need to provide access to users on a secondary database we will be able to create a login but not user on the read-only database. 192 more words


Nifty SQL regression to calculate donors' giving trends

Here’s a nifty bit of SQL that calculates a best-fit line through a donor’s years of cash-in giving by fiscal year (ignoring years with no giving), and classifies that donor in terms of how steeply they are “rising” or “falling”. 1,084 more words

Predictor Variables

The Power of Apply operator

Few days back when I was working on small query I come across a situation in which I have to select top few records based on the grouping of some column. 501 more words

SQL Query

SQL and HiveQL query examples

Well, we know that HiveQL is very similar to SQL. The detailed Hive Language Manual describes all the important functions and semantics that are used in Hive. 56 more words