Writing CASE WHEN Statements in SQL (IF/THEN)

Поделиться
HTML-код
  • Опубликовано: 9 июл 2024
  • Step-by-step tutorial shows you how to use the CASE WHEN statement in SQL to execute IF/THEN statements that customize your output!
    Get the Northwind Database: • How to Load a Sample P...
    Support the Channel:
    1) Subscribe: www.becomingads.com/o/youtube
    2) DataCamp:
    3) Udacity:
  • НаукаНаука

Комментарии • 76

  • @sarahemslie6105
    @sarahemslie6105 4 года назад +20

    An afternoon binge-watching your SQL videos is time well spent! Thank you for taking the time to make them. Subscribed.

    • @becomingADS
      @becomingADS  4 года назад +1

      That's awesome Sarah!! So happy to have helped ya out!

  • @ukaszk.8305
    @ukaszk.8305 3 года назад +11

    I'm using your videos as quick (yet pretty comprehensive!) introductions to the topics you cover. For that, you go at a perfect pace and level of detail for me. And you are always to the point, with no excessive intros. Simplicity is great! The overall quality is also pretty good. Thanks a lot for all your work and enthusiasm. Please keep going! :)

  • @griffinwillig4329
    @griffinwillig4329 Год назад +1

    Dude, you are legit the best. I have watched so many Coursera's and taken so many classes, and you by-far explain everything THE BEST. Keep on rocking.

  • @MichaelFlenderson
    @MichaelFlenderson 3 года назад +2

    Thank you! You’re a good teacher 🙏🏻

  • @anne7983
    @anne7983 Год назад

    Just the tutorial I need. Thank you so much!🤩

  • @ANUJYADAV-dj1iq
    @ANUJYADAV-dj1iq 4 года назад +2

    i have gone through many videos on youtube but I find my solution here at the end. thanks for making this video.

  • @krystianeotis6479
    @krystianeotis6479 3 года назад

    Your videos have been so helpful. Thank you!!!

  • @serenereader
    @serenereader Год назад

    You are an excellent teacher. Thank you!

  • @valentinacoy7757
    @valentinacoy7757 3 года назад

    Your videos are amazing, thank you so much!!!

  • @vaidehishah8867
    @vaidehishah8867 7 месяцев назад

    These videos were really helpful! Thanks a ton!

  • @nextdoortechieaminfirnash6002
    @nextdoortechieaminfirnash6002 Год назад

    It was right to the point. Thank you for a wonderful lesson.

  • @andrewkorneychuk586
    @andrewkorneychuk586 3 года назад

    Just want to say thank u for this great mysql tutorials

  • @stevencarv-buc3163
    @stevencarv-buc3163 3 года назад

    *Y repentinamente un comentario en español* xD
    Es justo lo que estaba buscando, te agradezco.
    Este canal es extremadamente útil.
    ¡un saludo Nathan!

  • @mishraadityaanandeavmjejdt265
    @mishraadityaanandeavmjejdt265 3 года назад

    Thank you so much for such a great content . It really helped me a lot.

  • @12245Fred
    @12245Fred 4 года назад

    Amazing explanation, thank you this helped a lot

  • @deadbrain1861
    @deadbrain1861 3 года назад

    Thank u I watched all sql playlist u r the best

  • @embisonjones4996
    @embisonjones4996 Год назад

    That you Nathan. You’ve earned a new subscriber

  • @anthonynorman1212
    @anthonynorman1212 2 года назад

    Your Video was perfect! Thank You

  • @jordanroywhite
    @jordanroywhite 3 года назад

    Thanks so much for the great video!

  • @dawitworku821
    @dawitworku821 2 месяца назад

    It's very helpful! Thank you.

  • @higiniofuentes2551
    @higiniofuentes2551 Год назад

    Thank you for this very useful video!

  • @user-ft7bi6qc8i
    @user-ft7bi6qc8i 7 месяцев назад

    Thank you so much for the help

  • @96aditishah
    @96aditishah 2 года назад

    Great explanation! Thanks

  • @ravinderthakur7973
    @ravinderthakur7973 2 года назад

    Thx a lot, it helps me a lot

  • @darylfgeorge
    @darylfgeorge 3 года назад

    great video, thank you!

  • @butchdavis2062
    @butchdavis2062 3 года назад

    Subscribed big time, thank you brother

  • @showutheworld
    @showutheworld 4 года назад +5

    Your videos are awesome!!! I'm currently taking a course and your second explanation is exactly what I need to understand the concepts better! Thank you! Please continue :) Already subscribed.

  • @MartinFaehrmann
    @MartinFaehrmann 3 года назад

    Very helpful video, thank you :)

  • @itzyfan88
    @itzyfan88 9 месяцев назад

    Very clear, thanks

  • @pv6010
    @pv6010 10 месяцев назад

    u r the man, thankxxxxxxx

  • @ashokandhra2268
    @ashokandhra2268 Месяц назад

    Thank you... It's helpful

  • @timothyhallbeck9853
    @timothyhallbeck9853 Год назад

    Good intro into Case, thanks.

  • @alexg97343
    @alexg97343 Год назад

    Great explanation

  • @mazinmohammed6624
    @mazinmohammed6624 3 года назад +1

    please continue with the database videos, if you could do some on T-SQL and SSM it'd be great!

  • @gonzalomartinez1575
    @gonzalomartinez1575 2 месяца назад

    Thanks very useful

  • @wiktor18071
    @wiktor18071 4 года назад +1

    Supporting the excellent wrk:)

  • @max1qin927
    @max1qin927 3 года назад +4

    Hi Nathan, your videos are amazing. I watched all about sql and helped me a lot. I find you stop uploading new videos. Could you please do your video again. I am sure they help a lot of people on the planet of Earth.

  • @LucHayman
    @LucHayman 3 года назад

    Awesome thank you!
    Is it possible to add multiple case statements in one query? How would I do that?

  • @KevinTempelx
    @KevinTempelx 3 года назад

    Thanks!

  • @attrinh8343
    @attrinh8343 6 месяцев назад

    verry good content

  • @simondreyfuss754
    @simondreyfuss754 2 года назад

    Jurassic Park: We're gonna make a fortune with this script....

  • @sailoben
    @sailoben 2 года назад +1

    I have been engaged to Udemy couse on MS SQL server, but some explainations are hard to understand. Whenever I have doubt This is where I go to. Keep making videos please. Thanks

  • @adityadalvi7884
    @adityadalvi7884 6 месяцев назад

    Thanks

  • @manavsaxena5579
    @manavsaxena5579 3 года назад

    Hey man, awesome tutorials. Is there anything coming on Window Functions?

  • @prasadkhairnar7915
    @prasadkhairnar7915 2 года назад

    thanks : )

  • @factorise001
    @factorise001 2 года назад +1

    waiting for new videos!!

  • @user-cz7tk3gh6w
    @user-cz7tk3gh6w 3 года назад +1

    good job

  • @abdulsami5843
    @abdulsami5843 3 года назад

    good tutorial, I am a bit confused about the sum(frieght) shouldn't the sum be increasing as we go down ?

  • @xesiusprime9360
    @xesiusprime9360 3 года назад

    right on man thanks very helpful and informative supplementation of my education when i dont understand them in how they describe it
    btw im wondering, I am almost done my SQL and i heard that i could find a foot in the door kind of job with just SQL. Is this true? how do i find it?

  • @yotsusan_machi
    @yotsusan_machi Год назад

    thank kyu mr

  • @thewaifupillow
    @thewaifupillow 3 года назад

    Awesine series, can you do one on correlated subqueries?

  • @montieeaster9883
    @montieeaster9883 3 года назад

    Can the Then output be another column rather than a text?

  • @christleiroezi8878
    @christleiroezi8878 3 года назад

    Hello, I have a huge Case statement query that groups a column into buckets, I am trying to count how many patients are in each bucket, How do I do that?The case statement does let me use the count function. Thanks

  • @andyn6053
    @andyn6053 3 года назад

    more sql videos pls :)

  • @ViciousZeroEnder
    @ViciousZeroEnder 3 года назад +1

    DO MORE SQL VIDEOS PLEASE!!!!

  • @kellensampson289
    @kellensampson289 3 года назад

    Question: is it possible to then sort out your results so that all the customers within the same weight range are listed together? For example, all the "heavy" customers are ordered first, then all the "medium" customers, then all the "light" customers? All within the same output?

    • @ViciousZeroEnder
      @ViciousZeroEnder 3 года назад +1

      if you do order by freight it would effectively do what ur askin

  • @kanknw
    @kanknw 3 года назад +1

    Can you make video about solving complex sql problem

  • @karlderkastn7012
    @karlderkastn7012 3 года назад

    tomorrow is my final exam, thanks :)

  • @BRAloni
    @BRAloni Год назад

    how to Write a query to display EMPLOYEES having ID 101,102,103 as per the
    below order: 1. 101, 2. 103, 3. 102 (Hint: Union Operator / Case Statement)
    QUERY

  • @BessieMartin-cl8sz
    @BessieMartin-cl8sz 8 месяцев назад

    interest!

  • @charmalvarez9717
    @charmalvarez9717 11 месяцев назад

    thank you so much, did you stop posting videos?

  • @danielmejia8530
    @danielmejia8530 3 года назад +1

    Very Nice. Can I use logic after WHEN? let's say: WHEN (condition_A AND condition_B) THEN something.

  • @Leopar525
    @Leopar525 Год назад

    I love your content but you should zoom in a bit.. too much empty space and we cannot see the letters without high definition when on mobile

  • @Yarunooo
    @Yarunooo 2 года назад

    SELECT UnitsOnOrder, CASE
    WHEN UnitsOnOrder > UnitsInStock THEN 'a'
    else 'test'
    End as BestellingenStock
    FROM Orders;
    01:46:40 SELECT UnitsOnOrder, CASE WHEN UnitsOnOrder > UnitsInStock THEN 'a' else 'test' End as BestellingenStock FROM Orders LIMIT 0, 2000 Error Code: 1054. Unknown column 'UnitsOnOrder' in 'field list' 0.016 sec

  • @Leopar525
    @Leopar525 Год назад

    I love your content but you should zoom in a bit.. too much empty space and we cannot see the letters without high definition when on movile

  • @praji1202
    @praji1202 2 года назад

    Where is the if condition?

  • @Helloimtheshiieet
    @Helloimtheshiieet Год назад

    Ok... but not if you do case when XYZ AND ABC then 1 else 0...

  • @mujtaba135
    @mujtaba135 3 года назад

    Need Help !!!!!!!!!!!

  • @harshavardhank9915
    @harshavardhank9915 2 года назад

    please use single quotes otherwise it won't work

  •  3 года назад

    Thanks

  • @Leopar525
    @Leopar525 Год назад

    I love your content but you should zoom in a bit.. too much empty space and we cannot see the letters without high definition when on mobile