LEFT, RIGHT, CHARINDEX and SUBSTRING functions in sql server   Part 23

LEFT, RIGHT, CHARINDEX and SUBSTRING functions in sql server Part 23

kudvenkat

11 лет назад

421,535 Просмотров

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


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

@maheshgirish6071
@maheshgirish6071 - 01.05.2023 09:05

Thank you so much Venkat sir great teaching

Ответить
@AnandKumar-dc2bf
@AnandKumar-dc2bf - 08.12.2022 08:39

Its better if you remove such very old videos and keep only new ones atlest 5 years old ...

Ответить
@chanchalarya983
@chanchalarya983 - 10.06.2022 18:09

sir how can I add $ in sum(total_amt) plz tell

Ответить
@vigneshvikey9392
@vigneshvikey9392 - 29.01.2022 18:14

Very useful videos, excellent teaching thank-you so much sir keep going and upload more videos 💐💐

Ответить
@ravindrababuravi5495
@ravindrababuravi5495 - 19.01.2022 18:51

Explained very well, thank you. Can you please explain how we can divide a value\text into columns if it consist of multiple underscores? like abc_123h_xyz, 2345x_TZ_5546.

Ответить
@hrushinathkale1372
@hrushinathkale1372 - 28.09.2021 11:53

Very Nice video sir. thank you so much for this series.

Ответить
@rasikadhanapala5354
@rasikadhanapala5354 - 06.08.2021 12:49

Excellent teaching. Thank you very much 👌

Ответить
@MrFaheemalig
@MrFaheemalig - 19.05.2021 19:17

DECLARE @full_path VARCHAR(500)= 'C:\Users\Michael\Documents\Microsoft SQL Server\MyScript.sql';
we want to pull "MyScript.sql
" this one from this full path but I need dynamically can you please answer this

Ответить
@harshag1335
@harshag1335 - 14.05.2021 23:17

Sir how do i display a name which is starting from 6th position (right end) and i want to display only 4 characters..

Ответить
@vkgupta
@vkgupta - 02.04.2021 15:16

In your last example, Can I use Alias name as EmailDomain After group by?

Ответить
@prashantx19
@prashantx19 - 22.03.2021 10:14

How can I separate the full_name column into the separate columns
EX- I have a table with concatenated full name and I want to display that into separate columns like first_name, middle_name, last_name
Prashant M sonawane
Amit S patil

Ответить
@technologyforalleasyway135
@technologyforalleasyway135 - 23.01.2021 12:26

hello sir, how to get a digit from right side after 4 digit, like from a number 101456678, want to get 4 but using right, please help

Ответить
@adduxe
@adduxe - 08.01.2021 07:21

I believe you can go GROUP BY EmailDomain instead teacher.

P.S. I was just offered a job yesterday after watching only 22 of your SQL videos! The extra notes you included in the video were actually included in the interview! (Whew!) THANK YOU SO MUCH!!!!!! Hat's off to you teacher!

Ответить
@asmitapatil8087
@asmitapatil8087 - 16.12.2020 12:57

Do you have any session on synonyms in sql

Ответить
@hasinmahjabeen7252
@hasinmahjabeen7252 - 26.08.2020 12:46

Cool!

Ответить
@codingstream572
@codingstream572 - 08.08.2020 04:30

is he from mycodeschool....?

Ответить
@navinkrishnan9419
@navinkrishnan9419 - 09.07.2020 03:29

thank you!

Ответить
@birdsdepartment
@birdsdepartment - 20.04.2020 08:41

Hello Sir How are you? Hope ou are fine. Please tell me how to use alias "Total" in a query such as (english+maths) as Total,(Total/MaxMarks)*100 as Percentage.

Ответить
@redietalemayehu640
@redietalemayehu640 - 22.02.2020 10:07

or we can easily use this query to get the last email id and then group them up. What do you think?
Select RIGHT(Email,Len(Email) - CharIndex('@',Email)), Count(*)
From tblEmployee
Group by RIGHT(Email,Len(Email) - CharIndex('@',Email))

Ответить
@rupeshthangella2059
@rupeshthangella2059 - 13.02.2020 16:19

Hi Sir, Can you make video regarding Partitions in Sql?

Ответить
@gregorym7598
@gregorym7598 - 04.11.2019 04:37

How and why is possible for example Sara to with
select CHARINDEX('@', Email)-2, Email from tblEmployee
be 2
and LEN of her Email is 11 here...so 11-2=9...........................
AND
select (LEN(Email) - CHARINDEX('@', Email)-2) from tblEmployee
be 5
so 11-2=5
I got it and know what happened, but can you explain this situation why SQL Server look like (11 - 4) - 2 = 5 when is obviously and logically 11 - 2 = 9
because CHARINDEX('@', Email)-2 giving output 9
If you have time and understand what I'm asking explain, even if I realized what happened here, explain why is this happening like this...when is particularly like I said 11-2=9

Ответить
@gregorym7598
@gregorym7598 - 04.11.2019 04:17

Venk, I was playing little with this and look what I found:
select SUBSTRING(Email, CHARINDEX('@',Email)-5,
(LEN(Email) - CHARINDEX('@', Email)-2)) Name
from tblEmployee
group by SUBSTRING(Email,CHARINDEX('@', Email)-5,
(LEN(Email) - CHARINDEX('@', Email)-2))
Well isn't it interesting...

Ответить
@newaribabu
@newaribabu - 30.09.2019 20:05

How can I apply the same syntax on ORACLE SQL Developers? This one is in MS SQL server and I'm using ORACLE SQL SERVER. Oracle doesn't support or recognize CHARINDEX command in Oracle. Anyone please?

Ответить
@flaeski
@flaeski - 30.08.2019 16:57

Muito boa explicação, parabéns!!!

Ответить
@devarakondasankararao3802
@devarakondasankararao3802 - 02.07.2019 21:49

Great explanation Sir

Ответить
@aliazad1118
@aliazad1118 - 03.05.2019 10:29

As usual perfect. Best tutorial

Ответить
@suprajacheppala2294
@suprajacheppala2294 - 01.02.2019 12:49

what is the syntax to get before @ for an email for whole table

Ответить
@sanasafinaz8549
@sanasafinaz8549 - 16.01.2019 18:04

how to get middle name from full name . Like in full name we have 'XYZ' and we have to extract z middle name

Ответить
@caothanhlong7577
@caothanhlong7577 - 02.11.2018 13:55

Wow very easy to understand! Thank you so much.

Ответить
@BoxerDogs
@BoxerDogs - 23.10.2018 21:38

Good explanation.  Thank you for posting this.

Ответить
@nolimit167
@nolimit167 - 23.08.2018 20:13

Thanks for the instructional videos! I've learned a ton from you Venkat. One question that i have is that , wouldn't the result still be the same if the last expression/argument in substring was left out? for example, substring(email,charindex('@',email)) would have been the same as substring(email,charindex('@',email), len(email)-charindex('@',email)?

Ответить
@aamirhalai4907
@aamirhalai4907 - 26.07.2018 17:55

As said in video what are the other ways to get final shown output??

Ответить
@davinder1910singh
@davinder1910singh - 28.06.2018 20:20

Suppose I have one String as "ABC EFG", now I want to pick the value using RIGHT function till first Space which comes. How Can I do that?

Ответить
@armanazote321
@armanazote321 - 25.05.2018 13:39

I want to extract strings: "Self Install Kit" in the log file: xxxxxx: xxxxxxx: xxxxxxx, xxxxxxx: xxxxxxx, xxxxx: xxxxx, xxxxxx: xxxxx, xxxxx: xxxxxxxxx, Install Responsibility: Customer, Install Kit: Self Install Kit, xxxxxxx: xxxxx;xxxxxx;xxxxx, xxxxx

can you help me with the how to locate all the log file that have "Self Install Kit".?

hope you can help.

thanks.

Ответить
@programmeseekho2795
@programmeseekho2795 - 24.05.2018 12:07

Thank You Sir
Very helpful Video..Very Nice Sir

Ответить
@pravallikakiran9198
@pravallikakiran9198 - 08.05.2018 10:12

While Explaining third argument of SUBSTRING() you have used total length of string - till where we do not require.
But my doubt is while defining the Substring() the second argument itself specifies the start position and so the third argument could be total length of the length.
select SUBSTRING('[email protected]',charindex('@','[email protected]')+1,len('[email protected]'))
could give the expedted reply na? why to use (-)minus and all?

I'm sorry i'm very much new to this IT field so just out of confusion/curiosity i'm posting my doubt.

Ответить
@Trzbne
@Trzbne - 31.03.2018 21:10

5 days without watching your videos... Hard and long week. Already here, enjoying your lesson :-) Thank you very much!

Ответить
@Raghav54321
@Raghav54321 - 09.02.2018 11:19

Hi Venkat could you please explain Substring function with negative (-1) parameter value like select substring(@string,-1,5) etc.

Ответить
@mranonymous1812
@mranonymous1812 - 11.01.2018 12:53

caaarindex

Ответить
@harshadgurav9281
@harshadgurav9281 - 24.09.2017 21:36

What to do if strong contain many same characters and if i want to calculate under of 3rd or 4rth character?

Ответить
@sohanyennu3750
@sohanyennu3750 - 28.06.2017 22:24

Such a useful concept explained very simply...I really appreciate your efforts!!

Ответить
@palcolon
@palcolon - 21.06.2017 17:21

Thank you my good sir

Ответить
@SaikatBhadury
@SaikatBhadury - 21.05.2017 19:50

Declare @Name nvarchar(50)
Set @Name='John Deo'
Declare @FirstLetter nvarchar(1)
Declare @SecondLetter nvarchar(1)
Set @FirstLetter=LEFT(@Name,1)
Set @SecondLetter=SUBSTRING(@Name,CHARINDEX(' ',@Name)+1,1)
SELECT 'Short Name = '+UPPER(@FirstLetter)+'.'+UPPER(@SecondLetter) AS ShortName


How To Do Like @Name='John Deo Something' As J.D.S Output

I Use It.. Thanks Sir

Ответить