{"id":15479,"date":"2020-04-21T09:59:49","date_gmt":"2020-04-21T09:59:49","guid":{"rendered":"https:\/\/dbtut.com\/?p=15479"},"modified":"2020-05-06T21:13:46","modified_gmt":"2020-05-06T21:13:46","slug":"mysql-if-statement-and-mysql-if-function","status":"publish","type":"post","link":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/","title":{"rendered":"MySQL IF Statement and MySQL IF() Function"},"content":{"rendered":"<p>The article contains information about MYSQL IF Statement, ELSEIF Statement and ELSE STATEMENT used to direct the command flow by condition in the MySQL VTY system.<\/p>\n<h3 class=\"LC20lb DKV0Md\">MySQL IF() Function<\/h3>\n<p>We can use two if statements: MySQL if function and if statement.<\/p>\n<p>MySQL if function is used in SQL commands. Similar to the ternary operator statement in programming languages.<\/p>\n<pre class=\"lang:default decode:true \">IF(Condition, True, False)<\/pre>\n<p>If the condition written to the first parameter of the MySQL IF function is true, it runs the TRUE parameter, and if it is false, it runs the FALSE parameter.<\/p>\n<h4>Using MySQL IF function;<\/h4>\n<pre class=\"lang:default decode:true \">SELECT IF(5 &gt; 6, \"5 is bigger\", \"6 is bigger\") AS result;<\/pre>\n<p>The IF function is also used in table queries.<\/p>\n<pre class=\"lang:default decode:true \">SELECT *, IF( product_price&gt; 30, \"Expensive\", \"Inexpensive\") AS result FROM Products;<\/pre>\n<p>The query will return &#8220;Expensive&#8221; as a result if the price in the product_price column is greater than 30, and &#8220;Inexpensive&#8221; if the product_price column is is smaller than 30.<\/p>\n<p>SQL functions can also be used within the MySQL IF function.<\/p>\n<pre class=\"lang:default decode:true\">SELECT *, IF( LENGTH(product_name) &gt; 10, \"LONG\", \"SHORT\") AS result FROM Products;<\/pre>\n<p>The query will return LONG if the product name length in the product_name column is greater than 10 characters, and SHORT if product_name column is smaller than 10 characters.<\/p>\n<h3>MySQL IF-ELSEIF-ELSE Statement<\/h3>\n<p>This allows using if, elseif and else statements to check the values \u200b\u200bin MySQL Stored Procedures.<\/p>\n<h4>MySQL If Usage;<\/h4>\n<pre class=\"lang:default decode:true \">IF Condition THEN\n  -- Commands\nEND IF;\n<\/pre>\n<h4>MySQL ElseIf Usage;<\/h4>\n<pre class=\"lang:default decode:true \">IF Condition THEN\n  -- Commands\nELSEIF Condition2 THEN\n  -- Commands2\nEND IF;\n<\/pre>\n<p>If Condition in IF is wrong AND Condition2 in ELSEIF is true, commands in Command2 are executed.<\/p>\n<h4>MySQL Else Usage;<\/h4>\n<pre class=\"lang:default decode:true \">IF Condition THEN\n  -- Commands\nELSE\n  -- Commands2\nEND IF;\n<\/pre>\n<p>or<\/p>\n<pre class=\"lang:default decode:true \">IF Condition1 THEN\n  -- Commands1\nELSEIF Condition2 THEN\n  -- Commands2\n...\nELSE\n  -- Commands3\nEND IF;<\/pre>\n<p>If all IF and ELSEIF conditions are wrong, commands3 in the ELSE section are executed.<\/p>\n<p>Below is an example of using if, elseif and else in stored procedures.<\/p>\n<pre class=\"lang:default decode:true\">DELIMITER \/\/\nCREATE PROCEDURE NameSurname(IN mynumber INT, OUT status VARCHAR(50))\nBEGIN\n\nIF mynumber = 1 THEN\n  SET status = 'Yusuf';\nELSEIF mynumber = 2 THEN\n  SET status = 'SEZER';\nELSEIF mynumber = 3 THEN\n  SET status = 'Yusuf SEZER';\nELSE\n  SET status = 'Yusuf Sefa SEZER';\nEND IF;\n\nEND\/\/\nDELIMITER ;<\/pre>\n<p>In the example, the NameSurname stored procedure returns different status values according to the MyNumber parameter.<\/p>\n<p>If the MyNumber parameter value is 1, the status parameter returns Yusuf, 2 if SEZER, 3 if Yusuf SEZER, if none, Yusuf Sefa SEZER.<\/p>\n<p>Let&#8217;s run the stored procedure.<\/p>\n<pre class=\"lang:default decode:true \">SET @result= 0;\nCALL NameSurname(99, @result);\nSELECT @result;<\/pre>\n<p>When the stored procedure is executed, it will return &#8220;Yusuf Sefa SEZER&#8221;.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_15479\" class=\"pvc_stats all  \" data-element-id=\"15479\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The article contains information about MYSQL IF Statement, ELSEIF Statement and ELSE STATEMENT used to direct the command flow by condition in the MySQL VTY system. MySQL IF() Function We can use two if statements: MySQL if function and if statement. MySQL if function is used in SQL commands. Similar to the ternary operator statement &hellip;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_15479\" class=\"pvc_stats all  \" data-element-id=\"15479\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":485,"featured_media":15480,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[9478,9479,9484,9476,9480,9482,9481,9477,9483],"class_list":["post-15479","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-mysql","tag-mysql-else-usage","tag-mysql-elseif-usage","tag-mysql-if-function","tag-mysql-if-statement","tag-mysql-if-usage","tag-mysql-if-elseif-else","tag-mysql-if-elseif-else-statement","tag-use-if-statement-in-mysql-stored-procedures","tag-using-mysql-if-function"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL IF Statement and MySQL IF() Function - Database Tutorials<\/title>\n<meta name=\"description\" content=\"MySQL IF Statement and MySQL IF() Function\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL IF Statement and MySQL IF() Function - Database Tutorials\" \/>\n<meta property=\"og:description\" content=\"MySQL IF Statement and MySQL IF() Function\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\" \/>\n<meta property=\"og:site_name\" content=\"Database Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-21T09:59:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-06T21:13:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"893\" \/>\n\t<meta property=\"og:image:height\" content=\"513\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Yusuf SEZER\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yusuf SEZER\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\"},\"author\":{\"name\":\"Yusuf SEZER\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a\"},\"headline\":\"MySQL IF Statement and MySQL IF() Function\",\"datePublished\":\"2020-04-21T09:59:49+00:00\",\"dateModified\":\"2020-05-06T21:13:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\"},\"wordCount\":306,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png\",\"keywords\":[\"MySQL Else Usage\",\"MySQL ElseIf Usage\",\"MySQL IF function\",\"MySQL IF Statement\",\"MySQL If Usage\",\"MySQL IF-ELSEIF-ELSE\",\"MySQL IF-ELSEIF-ELSE Statement\",\"use if statement in MYSQL stored procedures\",\"Using MySQL IF function\"],\"articleSection\":[\"MySQL-MariaDB\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\",\"url\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\",\"name\":\"MySQL IF Statement and MySQL IF() Function - Database Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png\",\"datePublished\":\"2020-04-21T09:59:49+00:00\",\"dateModified\":\"2020-05-06T21:13:46+00:00\",\"description\":\"MySQL IF Statement and MySQL IF() Function\",\"breadcrumb\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png\",\"width\":893,\"height\":513},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dbtut.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL IF Statement and MySQL IF() Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dbtut.com\/#website\",\"url\":\"https:\/\/dbtut.com\/\",\"name\":\"Database Tutorials\",\"description\":\"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux\",\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dbtut.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dbtut.com\/#organization\",\"name\":\"dbtut\",\"url\":\"https:\/\/dbtut.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"width\":223,\"height\":36,\"caption\":\"dbtut\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a\",\"name\":\"Yusuf SEZER\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g\",\"caption\":\"Yusuf SEZER\"},\"url\":\"https:\/\/dbtut.com\/index.php\/author\/yusufsezer\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL IF Statement and MySQL IF() Function - Database Tutorials","description":"MySQL IF Statement and MySQL IF() Function","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/","og_locale":"en_US","og_type":"article","og_title":"MySQL IF Statement and MySQL IF() Function - Database Tutorials","og_description":"MySQL IF Statement and MySQL IF() Function","og_url":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/","og_site_name":"Database Tutorials","article_published_time":"2020-04-21T09:59:49+00:00","article_modified_time":"2020-05-06T21:13:46+00:00","og_image":[{"width":893,"height":513,"url":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png","type":"image\/png"}],"author":"Yusuf SEZER","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Yusuf SEZER","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#article","isPartOf":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/"},"author":{"name":"Yusuf SEZER","@id":"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a"},"headline":"MySQL IF Statement and MySQL IF() Function","datePublished":"2020-04-21T09:59:49+00:00","dateModified":"2020-05-06T21:13:46+00:00","mainEntityOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/"},"wordCount":306,"commentCount":0,"publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png","keywords":["MySQL Else Usage","MySQL ElseIf Usage","MySQL IF function","MySQL IF Statement","MySQL If Usage","MySQL IF-ELSEIF-ELSE","MySQL IF-ELSEIF-ELSE Statement","use if statement in MYSQL stored procedures","Using MySQL IF function"],"articleSection":["MySQL-MariaDB"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/","url":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/","name":"MySQL IF Statement and MySQL IF() Function - Database Tutorials","isPartOf":{"@id":"https:\/\/dbtut.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png","datePublished":"2020-04-21T09:59:49+00:00","dateModified":"2020-05-06T21:13:46+00:00","description":"MySQL IF Statement and MySQL IF() Function","breadcrumb":{"@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#primaryimage","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2020\/04\/Ads\u0131z-5.png","width":893,"height":513},{"@type":"BreadcrumbList","@id":"https:\/\/dbtut.com\/index.php\/2020\/04\/21\/mysql-if-statement-and-mysql-if-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbtut.com\/"},{"@type":"ListItem","position":2,"name":"MySQL IF Statement and MySQL IF() Function"}]},{"@type":"WebSite","@id":"https:\/\/dbtut.com\/#website","url":"https:\/\/dbtut.com\/","name":"Database Tutorials","description":"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux","publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbtut.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dbtut.com\/#organization","name":"dbtut","url":"https:\/\/dbtut.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","width":223,"height":36,"caption":"dbtut"},"image":{"@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dbtut.com\/#\/schema\/person\/be8bf54494b6a89e626cbed2c940599a","name":"Yusuf SEZER","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19675b3db2d4ce370af047187123e2055a2b254ede3f0e7d9bc934da478146f7?s=96&d=mm&r=g","caption":"Yusuf SEZER"},"url":"https:\/\/dbtut.com\/index.php\/author\/yusufsezer\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/15479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/users\/485"}],"replies":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/comments?post=15479"}],"version-history":[{"count":0,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/15479\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media\/15480"}],"wp:attachment":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media?parent=15479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/categories?post=15479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/tags?post=15479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}