Printing a number pattern using SQL Query | Pattern using SQL | Print pattern using SQL | SQL Server

Опубликовано: 04 Февраль 2023
на канале: SQL With RaviMartha
52

Visit my blog for full script:


Palylists:
SQL Interview Questions:

SQL Tutorial Series for Beginners:

SQL Tips and Tricks:

SSIS Video Series:

SQL In 2 Minutes:



Video 27: Finding Tables with Identity columns - Part 27 | *
Video 26: Printing Star Patterns using SQL - Part 26 | *
Video 25: Fibonacci Series Using SQL - Part 25 | *
Video 24: Splitting data based on format in SQL | *
Video 23: Missing Sequence Number in SQL | Recursive CTE | Generate Sequence Number --*
Video 22: Comma Separated values to multiple rows | string_split() , Cross apply --*
Video 21: XML Path in SQL -
Video 20: Count and While loop in SQL -
Video 19: Warnings SQL? | Null value is eliminated by an aggregate or other SET operation --*
Video 18: Can we Update a View in SQL? --*
Video 17: Sorting in SQL | Sorting Interview Questions --*
Video 16: Union Vs Union All | With Examples | Prerequisites for Union and Union All | Performance Comparison --*
Video 15: Import data from File to table in SQL Server |.txt, .csv files to table|Import Flat File|Import Data --*
Video 14: Find Employees With Salary Lower Than Their Department Average in SQL --*
Video 13: Find Employees With Salary Lower Than Their Department Average in SQL --*
Video 12: Import Tables from one Server to another Using SSMS | Import tables using SQL Query in SSMS --*
Video 11: Table Variables in SQL Server | Pound Tables | Table Variable in SQL | Table Variable in Tempdb --*
Video 10: Quick Practical onTemporary tables in SQL Server | Temp Tables in SQL | Local Temp Table | Global Temp Table--*
Video 9: Temporary tables in SQL Server | Temp Tables in SQL | Local Temp Table | Global Temp Table -- *
Video 8: Running total & Avg in SQL | Cumulative Sum & Avg in SQL | Calculating running total & Avg in SQL -- *
Video 7 Title: Length Vs DataLength Vs ColumnLength | Len() | DataLength() | Col_Length | Column length in SQL -- *
Video 6 Title: Tricky CASE Statement Interview Questions | CASE WHEN | WHEN Clause | CASE Statement in SQL -- *
Video 5 Title: Delete Duplicates in SQL by retaining one Unique record | Row Duplicates | Business Key Duplicates -- *
Video 4 Title: Difference between TRUNCATE, DELETE and DROP -- *
Video 3 Title: Sorting in SQL | Order By | Conditional Sorting| Unusual Sorting --*
Video 2 Title: Difference between Primary Key and Unique Key --*
Video 1 Title: Logical Processing of SELECT Statement -- *
SQL Step by Step Video 8 Title: UPDATE | DELETE | WHERE | ALTER | DROP in SQL -- *

Blog:

Facebook Page:


DECLARE int = 1 -- Declare and Initialize counter
DECLARE int = 1 -- Declare and Initialize number to be printed
WHILE Lessthan= 5 -- Condition
BEGIN -- Begin
IF( = 1)
BEGIN
PRINT replicate( , -- Print
SET = + 1
IF( =1 AND -- once value becomes 6 on 5th iteration we increment the number just once
BEGIN
SET
PRINT replicate( ,
SET = - 2
END
END
ELSE
BEGIN
PRINT replicate( ,
SET = - 1 -- decreasing the counter and using the incremented number from above
IF(
BREAK;
END
END


Смотрите видео Printing a number pattern using SQL Query | Pattern using SQL | Print pattern using SQL | SQL Server онлайн без регистрации, длительностью 07 минут 40 секунд в хорошем hd качестве. Это видео добавил пользователь SQL With RaviMartha 04 Февраль 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 52 раз и оно понравилось людям.