{"id":6119,"date":"2021-05-07T12:29:11","date_gmt":"2021-05-07T12:29:11","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=6119"},"modified":"2021-05-07T12:30:17","modified_gmt":"2021-05-07T12:30:17","slug":"how-to-fix-syntax-error-or-access-violation-while-use-group-by","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/","title":{"rendered":"How to fix syntax error or access violation while use Group by"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"308\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-1024x308.png\" alt=\"\" class=\"wp-image-6121\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-1024x308.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-300x90.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-768x231.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1.png 1231w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">above error appear if you apply groupby  in controller function is given below figure<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group5-1024x462.png\" alt=\"\" class=\"wp-image-6123\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group5-1024x462.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group5-300x135.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group5-768x347.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group5-1536x694.png 1536w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group5.png 1681w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Solution 1:In config\/database.php at &#8220;mysql&#8221; change : &#8216;strict&#8217; =&gt; true, to false<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">reference :https:\/\/stackoverflow.com\/questions\/49635699\/laravel-distinct-on-join-results-not-working-in-query-builder<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group2-1-1024x462.png\" alt=\"\" class=\"wp-image-6125\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group2-1-1024x462.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group2-1-300x135.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group2-1-768x347.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group2-1-1536x694.png 1536w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group2-1.png 1681w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group4-1024x462.png\" alt=\"\" class=\"wp-image-6124\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group4-1024x462.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group4-300x135.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group4-768x347.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group4-1536x694.png 1536w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/group4.png 1681w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">now Your bug resolved<\/p>\n","protected":false},"excerpt":{"rendered":"<p>above error appear if you apply groupby in controller function is given below figure Solution 1:In config\/database.php at &#8220;mysql&#8221; change [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5049,1],"tags":[258,5052],"class_list":["post-6119","post","type-post","status-publish","format-standard","hentry","category-laravel","category-uncategorized","tag-error","tag-laravel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to fix syntax error or access violation while use Group by - scmGalaxy<\/title>\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.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to fix syntax error or access violation while use Group by - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"above error appear if you apply groupby in controller function is given below figure Solution 1:In config\/database.php at &#8220;mysql&#8221; change [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-07T12:29:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-07T12:30:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-1024x308.png\" \/>\n<meta name=\"author\" content=\"Rakesh K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rakesh K\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/\"},\"author\":{\"name\":\"Rakesh K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/00a5bea1933de2df743213c119a73645\"},\"headline\":\"How to fix syntax error or access violation while use Group by\",\"datePublished\":\"2021-05-07T12:29:11+00:00\",\"dateModified\":\"2021-05-07T12:30:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/\"},\"wordCount\":49,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/groupby-1-1024x308.png\",\"keywords\":[\"error\",\"laravel\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/\",\"name\":\"How to fix syntax error or access violation while use Group by - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/groupby-1-1024x308.png\",\"datePublished\":\"2021-05-07T12:29:11+00:00\",\"dateModified\":\"2021-05-07T12:30:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/00a5bea1933de2df743213c119a73645\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/groupby-1.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/groupby-1.png\",\"width\":1231,\"height\":370},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to fix syntax error or access violation while use Group by\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/00a5bea1933de2df743213c119a73645\",\"name\":\"Rakesh K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9cced70fe2d3021e1d865e7bb99782c4e69a5fa8c913adb83fae7aa47e692d5f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9cced70fe2d3021e1d865e7bb99782c4e69a5fa8c913adb83fae7aa47e692d5f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9cced70fe2d3021e1d865e7bb99782c4e69a5fa8c913adb83fae7aa47e692d5f?s=96&d=mm&r=g\",\"caption\":\"Rakesh K\"},\"description\":\"Hi I am Rakesh Experienced Web Developer with a demonstrated history of working in the information technology and services industry.\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/rakesh\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to fix syntax error or access violation while use Group by - scmGalaxy","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.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/","og_locale":"en_US","og_type":"article","og_title":"How to fix syntax error or access violation while use Group by - scmGalaxy","og_description":"above error appear if you apply groupby in controller function is given below figure Solution 1:In config\/database.php at &#8220;mysql&#8221; change [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/","og_site_name":"scmGalaxy","article_published_time":"2021-05-07T12:29:11+00:00","article_modified_time":"2021-05-07T12:30:17+00:00","og_image":[{"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-1024x308.png","type":"","width":"","height":""}],"author":"Rakesh K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rakesh K"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/"},"author":{"name":"Rakesh K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/00a5bea1933de2df743213c119a73645"},"headline":"How to fix syntax error or access violation while use Group by","datePublished":"2021-05-07T12:29:11+00:00","dateModified":"2021-05-07T12:30:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/"},"wordCount":49,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-1024x308.png","keywords":["error","laravel"],"articleSection":["Laravel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/","name":"How to fix syntax error or access violation while use Group by - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1-1024x308.png","datePublished":"2021-05-07T12:29:11+00:00","dateModified":"2021-05-07T12:30:17+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/00a5bea1933de2df743213c119a73645"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/groupby-1.png","width":1231,"height":370},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-fix-syntax-error-or-access-violation-while-use-group-by\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to fix syntax error or access violation while use Group by"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/00a5bea1933de2df743213c119a73645","name":"Rakesh K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9cced70fe2d3021e1d865e7bb99782c4e69a5fa8c913adb83fae7aa47e692d5f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9cced70fe2d3021e1d865e7bb99782c4e69a5fa8c913adb83fae7aa47e692d5f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cced70fe2d3021e1d865e7bb99782c4e69a5fa8c913adb83fae7aa47e692d5f?s=96&d=mm&r=g","caption":"Rakesh K"},"description":"Hi I am Rakesh Experienced Web Developer with a demonstrated history of working in the information technology and services industry.","url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/rakesh\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=6119"}],"version-history":[{"count":2,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6119\/revisions"}],"predecessor-version":[{"id":6127,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6119\/revisions\/6127"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=6119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=6119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=6119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}