{"id":1152,"date":"2018-01-14T03:21:31","date_gmt":"2018-01-14T10:21:31","guid":{"rendered":"https:\/\/sqltutorial.org\/?page_id=1152"},"modified":"2021-04-30T08:34:11","modified_gmt":"2021-04-30T15:34:11","slug":"sql-comparison-functions","status":"publish","type":"page","link":"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/","title":{"rendered":"SQL Comparison Functions"},"content":{"rendered":"\n<p>This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.<br>\n<input id=\"search\" class=\"light-table-filter\" type=\"text\" placeholder=\"Type to search...\" data-table=\"functions\"><\/p>\n\n\n\n<figure class=\"wp-block-table responsive functions\"><table><thead><tr><td><strong>Name<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><\/thead><tbody><tr><td><a class=\"icon-more\" href=\"https:\/\/www.sqltutorial.org\/sql-coalesce\/\">COALESCE<\/a><\/td><td>Return the first non-null argument in the argument list.<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/sql-decode\/\">DECODE<\/a><\/td><td>Learn how to add the procedural if-then-else logic to SQL queries.<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"https:\/\/www.sqltutorial.org\/sql-nullif\/\">NULLIF<\/a><\/td><td>Compare two expressions and return null if they are equal, otherwise, return the first expression.<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":63,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1152","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Comparison Functions<\/title>\n<meta name=\"description\" content=\"This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Comparison Functions\" \/>\n<meta property=\"og:description\" content=\"This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-30T15:34:11+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/\",\"url\":\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/\",\"name\":\"SQL Comparison Functions\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltutorial.org\/#website\"},\"datePublished\":\"2018-01-14T10:21:31+00:00\",\"dateModified\":\"2021-04-30T15:34:11+00:00\",\"description\":\"This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltutorial.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Comparison Functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltutorial.org\/#website\",\"url\":\"https:\/\/www.sqltutorial.org\/\",\"name\":\"SQL Tutorial\",\"description\":\"An Interactive SQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltutorial.org\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Comparison Functions","description":"This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.","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:\/\/www.sqltutorial.org\/sql-comparison-functions\/","og_locale":"en_US","og_type":"article","og_title":"SQL Comparison Functions","og_description":"This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.","og_url":"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/","og_site_name":"SQL Tutorial","article_modified_time":"2021-04-30T15:34:11+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/","url":"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/","name":"SQL Comparison Functions","isPartOf":{"@id":"https:\/\/www.sqltutorial.org\/#website"},"datePublished":"2018-01-14T10:21:31+00:00","dateModified":"2021-04-30T15:34:11+00:00","description":"This section provides you with the SQL comparison functions including COALESCE, DECODE, and NULLIF.","breadcrumb":{"@id":"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltutorial.org\/sql-comparison-functions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltutorial.org\/sql-comparison-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"SQL Comparison Functions"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltutorial.org\/#website","url":"https:\/\/www.sqltutorial.org\/","name":"SQL Tutorial","description":"An Interactive SQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/1152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/comments?post=1152"}],"version-history":[{"count":0,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/1152\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/media?parent=1152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}