Results for "pivot"
12 / 184 posts
Added columns in a table by dynamic ways
IF OBJECT_ID('AddedDynamicColumn','P') IS NOT NULL BEGIN DROP PROC AddedDynamicColumn END GO CREATE PROCEDURE AddedDynamicColumn AS BEGIN SELECT ED.empid,E…
How to get first date of given date or month.
Get First date of month: SELECT DATEFROMPARTS(YEAR(GETDATE()), MONTH(GETDATE()), 1) AS FirstDayOfCurrentMonth Create function for that IF NOT EXISTS (SELEC…
How to one series with comma separate(any Delimiter) value split into in rows
If we have one series with comma separate(any Delimiter) value and we want split into in rows, I have create function for that: IF OBJECT_ID('TF_SplitSerie…
How to use GOTO statement in SQL server
If you want to jump to a specific point in your SQL code, you can use the GOTO statement. The GOTO statement is used to exit a loop or a nested block of co…
How to use Magic (virtual) table INSERTED and DELETED in SQL server
Magic Tables are virtual tables that are automatically created and maintained by SQL Server for each data modification operation performed on a table. They…
How to find table column information by using SQL query
Comprehensive Guide to Fetching Table and Column Metadata with SQL Server Stored Procedures When working with databases, understanding the structure of tab…
Normalization in Databases
Normalization in a database is the process of organizing the data to reduce redundancy and improve data integrity. The main goal of normalization is to bre…
SQL Server Data type
SQL Server provides a variety of data types to store different kinds of data efficiently. Here are some commonly used SQL Server data types: CHAR(size): A …
WAITFOR in sql server
The WAITFOR statement in SQL Server is used to introduce a delay or wait period in the execution of a batch, transaction, or query. WAITFOR DELAY '00:00:05…
All Date Components in SQL
We get First Date , Last date ,month number, month Name,Year, Financial Year(Finyear), and Month Year from Date (Date Range of each single date). SET DATEF…
Pivoting and Unpivoting Data in SQL
Pivoting Data : Pivoting is the process of converting rows of data into columns, effectively changing the orientation of your data. It's useful when you ha…
PySpark Pivot and Unpivot DataFrame
✅ What is Pivot and Unpivot? Pivot = Convert rows into columns Unpivot = Convert columns into rows 🌀 Sample DataFrame Let’s start with a small DataFrame t…