Тёмный
No video :(

Searching for text in SQL Server: CHARINDEX and PATINDEX 

SQL Server 101
Подписаться 17 тыс.
Просмотров 22 тыс.
50% 1

In this video, we will be looking at how to search for text within bigger text searches.
My SQL Server Udemy courses are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: rebrand.ly/que...
98-364: Database Fundamentals (Microsoft SQL Server): rebrand.ly/dat...
70-462 SQL Server Database Administration (DBA): rebrand.ly/sql...
Microsoft SQL Server Reporting Services (SSRS): rebrand.ly/sql...
SQL Server Integration Services (SSIS): rebrand.ly/sql...
SQL Server Analysis Services (SSAS): rebrand.ly/sql...
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): rebrand.ly/mic...
----
In this video, I'll show you how to use the SQL Server functions CHARINDEX and PATINDEX to search for text in a table.
These functions are useful if you need to find a specific piece of text in a table. They both have the same syntax, so you can use either one depending on what you need. I'll also show you some examples of how to use these functions to search for text in a table. Thanks for watching!
CHARINDEX - this is the SQL Server equivalent of INSTR or FIND. SQL Server is 1-based, so the first character is character number 1, not 0. You can either start searching from the beginning, or from partway through the string.
PATINDEX - sometimes, looking for string literals is not sufficient. You may need to use wildcards such as % and _ as well. This is when you use PATINDEX. However, you must start searching from the beginning with PATINDEX.

Опубликовано:

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@emmanuelphiri2086
@emmanuelphiri2086 8 месяцев назад
In future most will realise how powerful this lesson was and come back to like and comment. Nice one Sir.
@sharpazn
@sharpazn Год назад
Thanks man you're a legend!!!!!!!
@BelegaerTheGreat
@BelegaerTheGreat Год назад
*muda muda muda muda muda muda muda muda!*
@rk-ej9ep
@rk-ej9ep Год назад
Nice sir..
@CanMont
@CanMont 3 года назад
Thank you so much
@neilostle9909
@neilostle9909 6 месяцев назад
Hello. From 1m40s you talk about how to find the 2nd 'e'. How would we find the third 'e' ?
@SQLServer101
@SQLServer101 6 месяцев назад
Hi Neil. Thank you for your question. It's exactly the same way. The final formula would be SELECT CHARINDEX('e', 'Hello there', 1+CHARINDEX('e', 'Hello there',1 + CHARINDEX('e', 'Hello there'))) . Phillip
@omotolaniomotayo5812
@omotolaniomotayo5812 2 года назад
Nice..
@AnshulMarele-gbaa
@AnshulMarele-gbaa Год назад
How to enable viewing syntax and command definition [while typing any command] in MS-SQL as we see in Excel
@SQLServer101
@SQLServer101 Год назад
Hi Anshul. Thank you for your question. This happens with functions - if you type SELECT CONVERT( , then as soon as you type ( you should see the syntax for the function CONVERT. However, you won't see it for SELECT - the syntax is too complex to be shown in such an environment. See learn.microsoft.com/en-us/sql/t-sql/queries/select-transact-sql for its syntax. Phillip
Далее
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Просмотров 883 тыс.
79 What are user defined functions in sql server
11:57
Просмотров 2,1 тыс.
SQL Server-10 (Complete String Functions in SQL)
34:21