Answers.Body: <p>The last time I saw something like this was when custom fields on a table had been added, a group had been created using these custom fields and subsequently the custom fields had physically been deleted. This meant the custom group cache table failed to create - the group used in the mailing was the culprit. I'd try using a different group as a test. If it works then look to rebuild your smart group - the full error in the SQL should point you in the right direction.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T16:11:09.873Z
Answers.LastActivityDate: 2017-10-09T16:11:09.873Z
Answers.UserDisplayName: Parvez Saleh
Body: <p>Any ideas what is causing this when we try to send out a mailing?</p>
  
  <pre><code>("DB Error: syntax error", 
  CREATE TEMPORARY TABLE civicrm_temp_group_contact_cache495 (SELECT 25 as grou...") #4 
  </code></pre>
  
  <p>mysql  Ver 14.14 Distrib 5.1.73</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-15T11:38:37.563Z
Comments.Text: First of all it will help us if you add your CiviCRM version and CMS. Do you have any customization in your CiviCRM installation?
Comments.UserDisplayName: ErikH - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-18T04:12:22.140Z
Comments.Text: No serious customisations. Version 4.7.22.
Comments.UserDisplayName: Interlated
Tags: <mailing>
Title: Error message on sending a mailing, CREATE TEMPORARY TABLE
ThreadText: # Error message on sending a mailing, CREATE TEMPORARY TABLE
  
  (Asked by: username_0 on 2017-09-15)
  
  Any ideas what is causing this when we try to send out a mailing?
  ("DB Error: syntax error", 
  CREATE TEMPORARY TABLE civicrm_temp_group_contact_cache495 (SELECT 25 as grou...") #4 
  
  mysql  Ver 14.14 Distrib 5.1.73
  
  **Tags:** mailing
  
  > **Comments:**
  > **username_1**: First of all it will help us if you add your CiviCRM version and CMS. Do you have any customization in your CiviCRM installation?  
  > **username_0**: No serious customisations. Version 4.7.22.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-10-09. Score: 1
  
  The last time I saw something like this was when custom fields on a table had been added, a group had been created using these custom fields and subsequently the custom fields had physically been deleted. This meant the custom group cache table failed to create - the group used in the mailing was the culprit. I'd try using a different group as a test. If it works then look to rebuild your smart group - the full error in the SQL should point you in the right direction.
  
  
  ---
  
  