SQL Query | How to insert line breaks in data | Carriage return | Line feed

SQL Query | How to insert line breaks in data | Carriage return | Line feed

Learn at Knowstar

2 года назад

14,451 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@adamduce9341
@adamduce9341 - 20.05.2022 15:47

Thanks for another good video. Just one minor correction - the order of the CHAR values should be CHAR(13) + CHAR(10), as this is CR and LF characters respectively.

Ответить
@vaishalibhalerao9821
@vaishalibhalerao9821 - 01.08.2023 10:59

Thanks for sharing. It was helpful. Thanks.

Ответить
@avinashc8146
@avinashc8146 - 28.05.2022 12:22

Give numbers to videos that would be better to search if we want again

Ответить
@mainlykanchan8740
@mainlykanchan8740 - 25.05.2022 10:17

Hello ma'am
Mere pc(mysql) me charindex work nhi krv rha h . Plz help

Ответить
@jamesgg9950
@jamesgg9950 - 24.05.2022 01:04

If you have a string with multiple lines and you want to select each line as its own row, a recursive CTE is the way to do it. I.E:

DECLARE @needle VARCHAR(1000), @data VARCHAR(100);

SET @needle = '.'; -- What character separates lines?
SET @data = 'This is line 1.This is line 2.This is line 3.This is line 4.This is line 5.';


WITH dataLines( lineNum, lineEnd ) AS (
SELECT 0, 0
UNION ALL
SELECT 1 + lineNum, CHARINDEX( @needle, @data, 1 + lineEnd )
FROM dataLines
WHERE lineNum = 0 OR lineEnd != 0 )


SELECT b.lineNum as 'lineNum',
SUBSTRING( @data, 1 + a.lineEnd, b.lineEnd - a.lineEnd ) as 'dataLine'
FROM dataLines a
LEFT JOIN dataLines b
ON 1 + a.lineNum = b.lineNum
WHERE b.lineEnd != 0

Ответить
@prakashbaravkar3476
@prakashbaravkar3476 - 20.05.2022 08:27

How to convert the image binary form to jpg file ?

Ответить
@manjutharak
@manjutharak - 20.05.2022 00:24

How we can do in Oracle SQL?

Ответить
@jacksparrowcapitan3232
@jacksparrowcapitan3232 - 19.05.2022 19:16

I would love to hear from you all day!! with all due respect

Great content as always

Ответить