SQL Tricks | How to find value in multiple columns ?

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

Learn at Knowstar

Learn at Knowstar

Күн бұрын

Пікірлер: 32
@swathiambi3849
@swathiambi3849 25 күн бұрын
Excellent!! Thank you!
@shekhark1139
@shekhark1139 Жыл бұрын
Oh my goodness, its very very helpful... Many thanks to you.
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you
@sivachandar5705
@sivachandar5705 Жыл бұрын
As per your example from Tbl1, If I want to find demo in col1, col2, col2, col4, col5 ? Pls reply
@smcgpra3874
@smcgpra3874 Жыл бұрын
I learnt lot from this channel, good explanation ma'am
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Glad to hear that
@avi8016
@avi8016 Жыл бұрын
Great video ma'am One question where 'cancelled' in (col1,col2) is available just in SQL server or is it universal?
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you. Might not work in all databases.
@hoperight5280
@hoperight5280 Жыл бұрын
I tried to perform it in pgadming and worked.
@gustavoadolfogomezacevedo3905
@gustavoadolfogomezacevedo3905 Жыл бұрын
Thanks!
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you so much for your support 🙏
@samarif6467
@samarif6467 6 ай бұрын
Can I use it for NULL in each of the columns
@kristyowens2284
@kristyowens2284 Жыл бұрын
Please share more SQL tips and tricks.
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Sure. More sql tips coming soon.
@maheshp5244
@maheshp5244 Жыл бұрын
Hi , I want to find max date for each tables present in each schema how to write it dynamically
@abdullahquhtani4247
@abdullahquhtani4247 Жыл бұрын
Excellent and will be great 💪🏼 if there is a way to loop all tables in a specific Database 🤔😏
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you. May need to write a stored procedure to loop through all table names.
@yallasailakshmankumar2714
@yallasailakshmankumar2714 Жыл бұрын
You can use EXEC sp_MSforeachtable, example for records count,EXEC sp_MSforeachtable 'SELECT ''?'' TableName, Count(1) NumRecords FROM ?'
@AnandKumar-dc2bf
@AnandKumar-dc2bf Жыл бұрын
Hi Mam! Can you do some mesium/ hard videos on sql leet code questions please...
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Sure. We are planning something soon. Stay tuned 👍
@amukelaniebenezer406
@amukelaniebenezer406 Жыл бұрын
Thanks for sharing
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you
@rk-ej9ep
@rk-ej9ep Жыл бұрын
Nice ma'am..👍
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
Thank you
@siddheshamrutkar8684
@siddheshamrutkar8684 Жыл бұрын
Nice Video.. But what if want to find only the Cancelled then in that case only two columns should appear..
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
It will output the whole record because we are performing a Select *.
@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
@rajeshbandari20041989
@rajeshbandari20041989 Жыл бұрын
How to make this work in oracle
@LearnatKnowstar
@LearnatKnowstar Жыл бұрын
If this does not work in oracle, then an or in where clause can always be used to compare each and every column value.
@nikolaybaranov2213
@nikolaybaranov2213 Жыл бұрын
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 Жыл бұрын
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.
PL/SQL | Stored Procedure | Create and Execute a User Stored Procedure
22:06
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 11 МЛН
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 18 МЛН
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 3,2 МЛН
Это было очень близко...
00:10
Аришнев
Рет қаралды 7 МЛН
SQL | Create and Execute Dynamic SQL Query | SQL Injection
19:14
Learn at Knowstar
Рет қаралды 8 М.
SQL - Multiple rows into comma separated values
7:14
dhandrohit
Рет қаралды 13 М.
8 Tips & Pointers to solve SQL Complex Queries ! (BONUS Tip Included !)
13:19
SQL tutorial | Date Functions | Difference between DATEDIFF and DATEADD
19:25
SQL | NOT IN Vs NOT EXISTS (Which one to use?)
10:03
Learn at Knowstar
Рет қаралды 11 М.
Learn how to write SQL Queries(Practice Complex SQL Queries)
49:56
Can You Find 5 Errors in This SQL Query? | SQL Debugging
13:51
Learn at Knowstar
Рет қаралды 938
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 11 МЛН