Find Nth highest salary using RANKING functions
Suppose you want to find nth highest salary from a table,Then
you can use DENSE_RANK() function.Here i show some example that...
2012-12-19
50,537 reads
Suppose you want to find nth highest salary from a table,Then
you can use DENSE_RANK() function.Here i show some example that...
2012-12-19
50,537 reads
Partitioning Table in SQL Server: When your database has large tables. Then partitioning will be beneficial
in terms of performance, scalability and maintainability....
2012-12-10
1,335 reads
Sending
Querying Data on Mail:
Sometimes we need to send data fetched from query on
mail automatically. You can
create report and after running...
2012-12-07
754 reads
Linked Server
Setup with Oracle in SQL Server:
Suppose you want to access data from
oracle or other database products using T-SQL via...
2012-10-23
2,274 reads
Querying Microsoft SQL Server : Basics of Indexes in SQL Server: Indexes in SQL Server: If you see a book, in...
2012-09-29
1,289 reads
Querying Microsoft SQL Server : Basics of Triggers in SQL Server: SQL Triggers: A trigger is a procedural code like stored...
2012-09-29
1,418 reads
Querying Microsoft SQL Server : Connection String from Visual Studio: Connection String: A connection string contains connection information need to connect...
2012-09-22
895 reads
Querying Microsoft SQL Server : Data Types in SQL Server: Data Type Description Remarks BIGINT Used for large Integer data.(Range -2^63 ...
2012-09-22
400 reads
Error Handling in T-SQL: Error handling in T-SQL: Error handling in T-SQL is similer to other programming languages as C#,C++,Java.A...
2012-09-22
630 reads
Functions in SQL Server: Functions in SQL Server In SQL Server functions are subrotienes that encapsulate a group of T-SQL...
2012-09-22
607 reads
By Steve Jones
I use ConEmu for my terminal interface. I’m still on Windows 10 at home,...
Creating a Fabric workspace takes about 30 seconds. Restructuring workspaces after people have built...
By Steve Jones
It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the...
Comments posted to this topic are about the item Adding new column with DEFAULT...
Comments posted to this topic are about the item Advanced Deployment Scenarios: Stairway to...
Comments posted to this topic are about the item You Need a DBA Pipeline
Which number did the two COUNT(*) return:
DROP TABLE IF EXISTS #tmp CREATE TABLE #tmp (id INT NOT NULL) INSERT INTO #tmp (id) SELECT gs.value FROM GENERATE_SERIES(1, 5) AS gs ALTER TABLE #tmp ADD my_value INT NOT NULL CONSTRAINT df_tmp_my_value DEFAULT 1 SELECT COUNT(*) FROM #tmp AS t WHERE my_value = 1 ALTER TABLE #tmp DROP CONSTRAINT df_tmp_my_value ALTER TABLE #tmp ADD CONSTRAINT df_tmp_my_value DEFAULT 2 FOR my_value SELECT COUNT(*) FROM #tmp AS t WHERE my_value = 1See possible answers