Learning MySQL - IF and NULLIF functions

preview_player
Показать описание
This episode explores the use cases for the IF and NULLIF functions inside your SELECT statements.

Рекомендации по теме
Комментарии
Автор

Started learning SQL, ended up watching some of these quality movies that I haven't seen already. Thank you!

paulalexei
Автор

Hi i have barcode column with 2 type of diffrent data how can i use if statment to diffrent out ( or in other way let mysql decide if code1 enterd do the select and condition ... and so on

ika
Автор

In IF statement we can use OR OPERATOR or not.
SELECT movie_id, director, year, if(movie_title LIKE 'H%' OR 'R%', movie_title, NULL) AS `H or R movie name` FROM movies;
if i run this query i only get the title that starts with H

ggdjbbp