SQL Tricks | How to find value in multiple columns ?

  Рет қаралды 12,598

Learn at Knowstar

Learn at Knowstar

Күн бұрын

Пікірлер: 32
@gustavoadolfogomezacevedo3905
@gustavoadolfogomezacevedo3905 Жыл бұрын
Thanks!
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you so much for your support 🙏
@swathiambi3849
@swathiambi3849 3 ай бұрын
Excellent!! Thank you!
@shekhark1139
@shekhark1139 Жыл бұрын
Oh my goodness, its very very helpful... Many thanks to you.
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you
@smcgpra3874
@smcgpra3874 2 жыл бұрын
I learnt lot from this channel, good explanation ma'am
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Glad to hear that
@amukelaniebenezer406
@amukelaniebenezer406 2 жыл бұрын
Thanks for sharing
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you
@rk-ej9ep
@rk-ej9ep 2 жыл бұрын
Nice ma'am..👍
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you
@abdullahquhtani4247
@abdullahquhtani4247 2 жыл бұрын
Excellent and will be great 💪🏼 if there is a way to loop all tables in a specific Database 🤔😏
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you. May need to write a stored procedure to loop through all table names.
@yallasailakshmankumar2714
@yallasailakshmankumar2714 2 жыл бұрын
You can use EXEC sp_MSforeachtable, example for records count,EXEC sp_MSforeachtable 'SELECT ''?'' TableName, Count(1) NumRecords FROM ?'
@kristyowens2284
@kristyowens2284 2 жыл бұрын
Please share more SQL tips and tricks.
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Sure. More sql tips coming soon.
@sivachandar5705
@sivachandar5705 Жыл бұрын
As per your example from Tbl1, If I want to find demo in col1, col2, col2, col4, col5 ? Pls reply
@AnandKumar-dc2bf
@AnandKumar-dc2bf 2 жыл бұрын
Hi Mam! Can you do some mesium/ hard videos on sql leet code questions please...
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Sure. We are planning something soon. Stay tuned 👍
@samarif6467
@samarif6467 8 ай бұрын
Can I use it for NULL in each of the columns
@maheshp5244
@maheshp5244 Жыл бұрын
Hi , I want to find max date for each tables present in each schema how to write it dynamically
@avi8016
@avi8016 2 жыл бұрын
Great video ma'am One question where 'cancelled' in (col1,col2) is available just in SQL server or is it universal?
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you. Might not work in all databases.
@hoperight5280
@hoperight5280 2 жыл бұрын
I tried to perform it in pgadming and worked.
@siddheshamrutkar8684
@siddheshamrutkar8684 2 жыл бұрын
Nice Video.. But what if want to find only the Cancelled then in that case only two columns should appear..
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
It will output the whole record because we are performing a Select *.
@rajeshbandari20041989
@rajeshbandari20041989 2 жыл бұрын
How to make this work in oracle
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
If this does not work in oracle, then an or in where clause can always be used to compare each and every column value.
@nakuldeep7336
@nakuldeep7336 Жыл бұрын
Select gold as Player,count(1) from events k where not Exists (Select * from events p where k.gold=p.silver) and not exists (Select * from events C where k.gold=C.BRONZE) group by GOLD
@nikolaybaranov2213
@nikolaybaranov2213 2 жыл бұрын
Yes, this script is functional. But: 1. Dynamic queries are evil. Supporting such code is very time consuming 2. Code is vendor dependent and not portable 3. I can hardly imagine a situation where the table name is known in the database, but the column names are unknown or they can change arbitrarily. The above example shows that the base is not even in second normal form. This is not a base, but complete chaos. Instead of writing queries to this database, I would rather quit.
@LearnatKnowstar
@LearnatKnowstar 2 жыл бұрын
Thank you for your comments. They are always insightful and knowledgeable. Yes, I agree this is not the best example of writing a code and should be used just as a quick trick for simpler requirements.
SQL | Lets create a Christmas Tree | Recursive CTE | Holiday Season
13:49
Learn at Knowstar
Рет қаралды 1,8 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Learn 12 Basic SQL Concepts in 15 Minutes (project files included!)
16:48
Querying 100 Billion Rows using SQL, 7 TB in a single table
9:07
Arpit Agrawal (Elastiq.AI)
Рет қаралды 56 М.
SQL | Create and Execute Dynamic SQL Query | SQL Injection
19:14
Learn at Knowstar
Рет қаралды 9 М.
SQL Views Tutorial | VIEWS in SQL Complete Tutorial
43:20
techTFQ
Рет қаралды 300 М.
SQL tutorial | Date Functions | Difference between DATEDIFF and DATEADD
19:25
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН