Answers.Body: <p>It should be fixed in the latest rc (5.2) <a href="https://download.civicrm.org/latest" rel="nofollow noreferrer">https://download.civicrm.org/latest</a></p>
  
  <p>From ChaosBuster:
  Was able to install the latest at this time, 5.1.2, and I am now able to query with the Search Builder for groups for the situation that was mentioned above.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-08T22:10:36.237Z
Answers.Text: Also note - this affects sites with mysql mode FULL GROUP BY enabled - you can disable that mode in your sql config
Answers.UserDisplayName: user4278
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-08T21:38:46.387Z
Answers.LastActivityDate: 2018-07-10T13:26:01.457Z
Answers.LastEditDate: 2018-07-10T13:26:01.457Z
Answers.UserDisplayName: user4278
Answers.Body: <p>This may be a bug in 5.0.0. The Drupal Demo site (and our 5.0.0 + Drupal 7 site) fails with a similar message if you try to do a search builder search for Contacts > group = or &lt;>. In our site, the error message also involves 'civicrm_group_contact.status' as an unknown field. Naturally, I can't see the log in the demo site, but the error reported on screen is the same.</p>
  
  <p>I don't know how to post a bug... but hope this might help raise one!
  (I tried going to the issue tracker, but it's been moved to git hub and I couldn't spot how to report a bug there.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-08T17:59:00.330Z
Answers.Text: I just tried this on our recently updated 5.0.2rc and same behaviour.
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-08T21:53:47.440Z
Answers.Text: Andyg8, you aren't on rc 5.2, correct? You indicated 5.0.2rc..same as my version.  user4278 indicated a few minutes ago that this was fixed in 5.2.  I will be out all day tomorrow and not willing to do the change the day before, but willing to give it a go later this week.
Answers.UserDisplayName: ChaosBuster
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-09T20:29:36.770Z
Answers.Text: Yes, I am on 5.0.2rc. And there is indeed a bug associated with this behaviour - at least in our case: https://lab.civicrm.org/dev/core/issues/106. 
  I believe it has been fixed for 5.2rc.
Answers.UserDisplayName: Andyg8
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-07T21:09:38.483Z
Answers.LastActivityDate: 2018-05-07T21:09:38.483Z
Answers.UserDisplayName: Andyg8
Answers.Body: <p>If logging is enabled, try disabling logging and re-enabling logging.  I had a somewhat similar error, but it's different enough that it may not be the same issue.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-27T21:53:20.697Z
Answers.Text: I tried this (+ resetting session) before posting.  Thanks for helping me remember though, so others will know.  ;-)
Answers.UserDisplayName: ChaosBuster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-27T17:19:33.770Z
Answers.LastActivityDate: 2018-04-27T17:19:33.770Z
Answers.UserDisplayName: G H
Answers.Body: <p>This may be related to <a href="https://civicrm.stackexchange.com/questions/24678/how-to-search-for-all-contacts-without-a-tag-registered-for-event">my issue too</a> - in the meantime, i found (due to the great answer Jon gave) that doing search -> custom search -> include / exclude search - I was able to get the results I wanted.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-30T05:27:04.630Z
Answers.LastActivityDate: 2018-04-30T05:27:04.630Z
Answers.UserDisplayName: themak
Body: <p>Since updating my CiviCRM 4.7.30 on WordPress 4.9.5, I am getting "DB Error: No such field" when doing queries through Advanced Search or Search Builder.  Some of the problems where when I was trying to use a Profile to view an Advanced Search and others were related to fields that I was trying to search by (my assumption is that they are fields that need lookups, but I haven't been able to narrow this down yet).  Below is an example Search Builder query that I tried and the resulting error that was in the CiviCRM log file located in the /wp-content/uploads/civicrm/ConfigAndLog directory.</p>
  
  <p>The query was to find Organizations that were Not In two designated groups shown in the image below:
  <a href="https://i.sstatic.net/qSDzM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qSDzM.png" alt="enter image description here"></a></p>
  
  <p>Not sure if it helps but when I used the Back Key to get back to review my previous query the query screen looked like the following:</p>
  
  <p><a href="https://i.sstatic.net/16jOk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/16jOk.png" alt="enter image description here"></a></p>
  
  <p>The related error in the CiviCRM log file was:</p>
  
  <pre><code>&gt; Apr 27 10:25:32  [info] $Fatal Error Details = Array (
  &gt;     [callback] =&gt; Array
  &gt;         (
  &gt;             [0] =&gt; CRM_Core_Error
  &gt;             [1] =&gt; handle
  &gt;         )
  &gt; 
  &gt;     [code] =&gt; -19
  &gt;     [message] =&gt; DB Error: no such field
  &gt;     [mode] =&gt; 16
  &gt;     [debug_info] =&gt; SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type
  &gt; as `contact_sub_type`, contact_a.sort_name as `sort_name`, 
  &gt;             CONCAT_WS(',',
  &gt;             GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
  &gt;             GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
  &gt;           )
  &gt;           as groups   FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-43,47` ON (contact_a.id =
  &gt; `civicrm_group_contact-43,47`.contact_id AND
  &gt; `civicrm_group_contact-43,47`.status IN ('Added'))  WHERE  (  (  ( (
  &gt; `civicrm_group_contact-43,47`.group_id NOT IN ( 43,47 )  ) )  AND
  &gt; contact_a.contact_type = 'organization' )  )  AND
  &gt; (contact_a.is_deleted = 0)   GROUP BY contact_a.id  ORDER BY
  &gt; UPPER(LEFT(contact_a.sort_name, 1)) asc  [nativecode=1054 ** Unknown
  &gt; column 'civicrm_group_contact.status' in 'field list']
  &gt;     [type] =&gt; DB_Error
  &gt;     [user_info] =&gt; SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type
  &gt; as `contact_sub_type`, contact_a.sort_name as `sort_name`, 
  &gt;             CONCAT_WS(',',
  &gt;             GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
  &gt;             GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
  &gt;           )
  &gt;           as groups   FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-43,47` ON (contact_a.id =
  &gt; `civicrm_group_contact-43,47`.contact_id AND
  &gt; `civicrm_group_contact-43,47`.status IN ('Added'))  WHERE  (  (  ( (
  &gt; `civicrm_group_contact-43,47`.group_id NOT IN ( 43,47 )  ) )  AND
  &gt; contact_a.contact_type = 'organization' )  )  AND
  &gt; (contact_a.is_deleted = 0)   GROUP BY contact_a.id  ORDER BY
  &gt; UPPER(LEFT(contact_a.sort_name, 1)) asc  [nativecode=1054 ** Unknown
  &gt; column 'civicrm_group_contact.status' in 'field list']
  &gt;     [to_string] =&gt; [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix=""
  &gt; info="SELECT contact_a.id as contact_id, contact_a.contact_type as
  &gt; `contact_type`, contact_a.contact_sub_type as `contact_sub_type`,
  &gt; contact_a.sort_name as `sort_name`, 
  &gt;             CONCAT_WS(',',
  &gt;             GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
  &gt;             GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
  &gt;           )
  &gt;           as groups   FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-43,47` ON (contact_a.id =
  &gt; `civicrm_group_contact-43,47`.contact_id AND
  &gt; `civicrm_group_contact-43,47`.status IN ('Added'))  WHERE  (  (  ( (
  &gt; `civicrm_group_contact-43,47`.group_id NOT IN ( 43,47 )  ) )  AND
  &gt; contact_a.contact_type = 'organization' )  )  AND
  &gt; (contact_a.is_deleted = 0)   GROUP BY contact_a.id  ORDER BY
  &gt; UPPER(LEFT(contact_a.sort_name, 1)) asc  [nativecode=1054 ** Unknown
  &gt; column 'civicrm_group_contact.status' in 'field list']"] )
  &gt; 
  &gt; 
  &gt; Apr 27 10:25:32  [info] $backTrace = #0
  &gt; /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232):
  &gt; CRM_Core_Error::backtrace("backTrace", TRUE)
  &gt; #1 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921):
  &gt; CRM_Core_Error::handle(Object(DB_Error))
  &gt; #2 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(985):
  &gt; PEAR_Error-&gt;__construct("DB Error: no such field", -19, 16, (Array:2),
  &gt; "SELECT contact_a.id as contact_id, contact_a.contact_type as
  &gt; `contact_type`, ...")
  &gt; #3 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575):
  &gt; DB_Error-&gt;__construct(-19, 16, (Array:2), "SELECT contact_a.id as
  &gt; contact_id, contact_a.contact_type as `contact_type`, ...")
  &gt; #4 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223):
  &gt; PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT
  &gt; contact_a.id as contact_id, contact_a.contact_type as `contact_type`,
  &gt; ...", "DB_Error", TRUE)
  &gt; #5 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905):
  &gt; PEAR-&gt;__call("raiseError", (Array:7))
  &gt; #6 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933):
  &gt; DB_common-&gt;raiseError(-19, NULL, NULL, "SELECT contact_a.id as
  &gt; contact_id, contact_a.contact_type as `contact_type`, ...", "1054 **
  &gt; Unknown column 'civicrm_group_contact.status' in 'field list'")
  &gt; #7 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403):
  &gt; DB_mysqli-&gt;mysqliRaiseError()
  &gt; #8 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216):
  &gt; DB_mysqli-&gt;simpleQuery("SELECT contact_a.id as contact_id,
  &gt; contact_a.contact_type as `contact_type`, ...")
  &gt; #9 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2446):
  &gt; DB_common-&gt;query("SELECT contact_a.id as contact_id,
  &gt; contact_a.contact_type as `contact_type`, ...")
  &gt; #10 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1635):
  &gt; DB_DataObject-&gt;_query("SELECT contact_a.id as contact_id,
  &gt; contact_a.contact_type as `contact_type`, ...")
  &gt; #11 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(392):
  &gt; DB_DataObject-&gt;query("SELECT contact_a.id as contact_id,
  &gt; contact_a.contact_type as `contact_type`, ...")
  &gt; #12 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1348):
  &gt; CRM_Core_DAO-&gt;query("SELECT contact_a.id as contact_id,
  &gt; contact_a.contact_type as `contact_type`, ...", TRUE)
  &gt; #13 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(4942):
  &gt; CRM_Core_DAO::executeQuery("SELECT contact_a.id as contact_id,
  &gt; contact_a.contact_type as `contact_type`, ...")
  &gt; #14 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Selector.php(1181):
  &gt; CRM_Contact_BAO_Query-&gt;searchQuery(NULL, NULL, NULL, FALSE, FALSE,
  &gt; TRUE)
  &gt; #15 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(108):
  &gt; CRM_Contact_Selector-&gt;alphabetQuery()
  &gt; #16 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(136):
  &gt; CRM_Utils_PagerAToZ::getDynamicCharacters(Object(CRM_Contact_Selector),
  &gt; FALSE)
  &gt; #17 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(52):
  &gt; CRM_Utils_PagerAToZ::createLinks(Object(CRM_Contact_Selector), NULL,
  &gt; FALSE)
  &gt; #18 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Search.php(839):
  &gt; CRM_Utils_PagerAToZ::getAToZBar(Object(CRM_Contact_Selector), NULL)
  &gt; #19 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Search/Builder.php(414):
  &gt; CRM_Contact_Form_Search-&gt;postProcess()
  &gt; #20 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(447):
  &gt; CRM_Contact_Form_Search_Builder-&gt;postProcess()
  &gt; #21 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Refresh.php(75):
  &gt; CRM_Core_Form-&gt;mainProcess()
  &gt; #22 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203):
  &gt; CRM_Core_QuickForm_Action_Refresh-&gt;perform(Object(CRM_Contact_Form_Search_Builder),
  &gt; "refresh")
  &gt; #23 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103):
  &gt; HTML_QuickForm_Controller-&gt;handle(Object(CRM_Contact_Form_Search_Builder), "refresh")
  &gt; #24 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351):
  &gt; HTML_QuickForm_Page-&gt;handle("refresh")
  &gt; #25 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309):
  &gt; CRM_Core_Controller-&gt;run((Array:4), (Array:0))
  &gt; #26 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84):
  &gt; CRM_Core_Invoke::runItem((Array:13))
  &gt; #27 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52):
  &gt; CRM_Core_Invoke::_invoke((Array:4))
  &gt; #28 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm.php(1246):
  &gt; CRM_Core_Invoke::invoke((Array:4))
  &gt; #29 /home/coloradomaker/www/www/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress-&gt;invoke("")
  &gt; #30 /home/coloradomaker/www/www/wp-includes/class-wp-hook.php(310): WP_Hook-&gt;apply_filters("", (Array:1))
  &gt; #31 /home/coloradomaker/www/www/wp-includes/plugin.php(453): WP_Hook-&gt;do_action((Array:1))
  &gt; #32 /home/coloradomaker/www/www/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T21:14:06.167Z
Comments.Text: Or rerun your group cache rebuild since i see "Unknown
  > column 'civicrm_group_contact.status'" in your error
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T21:54:18.823Z
Comments.Text: I assume you mean removing all files in my template_c directory.  Will give it a try...be back as it takes awhile.
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T21:59:14.807Z
Comments.Text: While waiting...I checked my *Clean-up Temporary Data and Files* scheduled job and it ran with no errors.  It executes hourly.
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T22:05:30.187Z
Comments.Text: After deleting all files under the templates_c directory, I went to *Administer > System Settings > Cleanup Caches and Update Paths* and selected *Cleanup Caches* then *Reset Paths*. Same DB Error using the same Search Builder query above.
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T22:26:36.663Z
Comments.Text: While in the Scheduled Jobs area decided to run some of them related to cache and updates.  The following finished execution with Success (1):  *Update Check* and *Disable expired relationships*.
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T22:28:43.757Z
Comments.Text: In following some of the steps on the System Administrator / Troubleshooting section under Rebuilding triggers I executed the following URL but still did not fix:  http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2F%25menu%2F%25rebuild%3Freset%3D1&triggerRebuild=1
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T22:36:18.520Z
Comments.Text: I decided to also run the *Rebuild Smart Group Cache* Scheduled Job and it finished execution with Success (1),
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T22:37:26.863Z
Comments.Text: Ran the *Clean-up Temporary Data and Files* job manually. The Full message:  Finished execution of Clean-up Temporary Data and Files with result: Success (empty values!)
Comments.UserDisplayName: ChaosBuster
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-04-27T22:41:20.923Z
Comments.Text: BTW, I am able to go to *Contacts > Manage Groups* and get a list of groups.   When I click on a group it does display the contacts in the group.  Also, I am able to use a Profile that has all my subscription groups (set to *Expose Publicly*), make changes to the groups that I'm subscribed to and save with no errors.
Comments.UserDisplayName: ChaosBuster
Tags: <upgrade><database><search-builder><5.0>
Title: After upgrade to 5.0.2 from 4.7.30 getting "DB Error: No such field" on queries
ThreadText: # After upgrade to 5.0.2 from 4.7.30 getting "DB Error: No such field" on queries
  
  (Asked by: username_0 on 2018-04-27)
  
  Since updating my CiviCRM 4.7.30 on WordPress 4.9.5, I am getting "DB Error: No such field" when doing queries through Advanced Search or Search Builder.  Some of the problems where when I was trying to use a Profile to view an Advanced Search and others were related to fields that I was trying to search by (my assumption is that they are fields that need lookups, but I haven't been able to narrow this down yet).  Below is an example Search Builder query that I tried and the resulting error that was in the CiviCRM log file located in the /wp-content/uploads/civicrm/ConfigAndLog directory.
  The query was to find Organizations that were Not In two designated groups shown in the image below:
  
  Not sure if it helps but when I used the Back Key to get back to review my previous query the query screen looked like the following:
  
  The related error in the CiviCRM log file was:
  > Apr 27 10:25:32  [info] $Fatal Error Details = Array (
  >     [callback] => Array
  >         (
  >             [0] => CRM_Core_Error
  >             [1] => handle
  >         )
  > 
  >     [code] => -19
  >     [message] => DB Error: no such field
  >     [mode] => 16
  >     [debug_info] => SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type
  > as `contact_sub_type`, contact_a.sort_name as `sort_name`, 
  >             CONCAT_WS(',',
  >             GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
  >             GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
  >           )
  >           as groups   FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-43,47` ON (contact_a.id =
  > `civicrm_group_contact-43,47`.contact_id AND
  > `civicrm_group_contact-43,47`.status IN ('Added'))  WHERE  (  (  ( (
  > `civicrm_group_contact-43,47`.group_id NOT IN ( 43,47 )  ) )  AND
  > contact_a.contact_type = 'organization' )  )  AND
  > (contact_a.is_deleted = 0)   GROUP BY contact_a.id  ORDER BY
  > UPPER(LEFT(contact_a.sort_name, 1)) asc  [nativecode=1054 ** Unknown
  > column 'civicrm_group_contact.status' in 'field list']
  >     [type] => DB_Error
  >     [user_info] => SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type
  > as `contact_sub_type`, contact_a.sort_name as `sort_name`, 
  >             CONCAT_WS(',',
  >             GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
  >             GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
  >           )
  >           as groups   FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-43,47` ON (contact_a.id =
  > `civicrm_group_contact-43,47`.contact_id AND
  > `civicrm_group_contact-43,47`.status IN ('Added'))  WHERE  (  (  ( (
  > `civicrm_group_contact-43,47`.group_id NOT IN ( 43,47 )  ) )  AND
  > contact_a.contact_type = 'organization' )  )  AND
  > (contact_a.is_deleted = 0)   GROUP BY contact_a.id  ORDER BY
  > UPPER(LEFT(contact_a.sort_name, 1)) asc  [nativecode=1054 ** Unknown
  > column 'civicrm_group_contact.status' in 'field list']
  >     [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix=""
  > info="SELECT contact_a.id as contact_id, contact_a.contact_type as
  > `contact_type`, contact_a.contact_sub_type as `contact_sub_type`,
  > contact_a.sort_name as `sort_name`, 
  >             CONCAT_WS(',',
  >             GROUP_CONCAT(DISTINCT IF(civicrm_group_contact.status = 'Added', civicrm_group_contact.group_id, '')),
  >             GROUP_CONCAT(DISTINCT civicrm_group_contact_cache.group_id)
  >           )
  >           as groups   FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-43,47` ON (contact_a.id =
  > `civicrm_group_contact-43,47`.contact_id AND
  > `civicrm_group_contact-43,47`.status IN ('Added'))  WHERE  (  (  ( (
  > `civicrm_group_contact-43,47`.group_id NOT IN ( 43,47 )  ) )  AND
  > contact_a.contact_type = 'organization' )  )  AND
  > (contact_a.is_deleted = 0)   GROUP BY contact_a.id  ORDER BY
  > UPPER(LEFT(contact_a.sort_name, 1)) asc  [nativecode=1054 ** Unknown
  > column 'civicrm_group_contact.status' in 'field list']"] )
  > 
  > 
  > Apr 27 10:25:32  [info] $backTrace = #0
  > /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232):
  > CRM_Core_Error::backtrace("backTrace", TRUE)
  > #1 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921):
  > CRM_Core_Error::handle(Object(DB_Error))
  > #2 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(985):
  > PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2),
  > "SELECT contact_a.id as contact_id, contact_a.contact_type as
  > `contact_type`, ...")
  > #3 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575):
  > DB_Error->__construct(-19, 16, (Array:2), "SELECT contact_a.id as
  > contact_id, contact_a.contact_type as `contact_type`, ...")
  > #4 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223):
  > PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT
  > contact_a.id as contact_id, contact_a.contact_type as `contact_type`,
  > ...", "DB_Error", TRUE)
  > #5 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905):
  > PEAR->__call("raiseError", (Array:7))
  > #6 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933):
  > DB_common->raiseError(-19, NULL, NULL, "SELECT contact_a.id as
  > contact_id, contact_a.contact_type as `contact_type`, ...", "1054 **
  > Unknown column 'civicrm_group_contact.status' in 'field list'")
  > #7 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403):
  > DB_mysqli->mysqliRaiseError()
  > #8 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216):
  > DB_mysqli->simpleQuery("SELECT contact_a.id as contact_id,
  > contact_a.contact_type as `contact_type`, ...")
  > #9 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2446):
  > DB_common->query("SELECT contact_a.id as contact_id,
  > contact_a.contact_type as `contact_type`, ...")
  > #10 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1635):
  > DB_DataObject->_query("SELECT contact_a.id as contact_id,
  > contact_a.contact_type as `contact_type`, ...")
  > #11 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(392):
  > DB_DataObject->query("SELECT contact_a.id as contact_id,
  > contact_a.contact_type as `contact_type`, ...")
  > #12 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1348):
  > CRM_Core_DAO->query("SELECT contact_a.id as contact_id,
  > contact_a.contact_type as `contact_type`, ...", TRUE)
  > #13 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(4942):
  > CRM_Core_DAO::executeQuery("SELECT contact_a.id as contact_id,
  > contact_a.contact_type as `contact_type`, ...")
  > #14 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Selector.php(1181):
  > CRM_Contact_BAO_Query->searchQuery(NULL, NULL, NULL, FALSE, FALSE,
  > TRUE)
  > #15 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(108):
  > CRM_Contact_Selector->alphabetQuery()
  > #16 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(136):
  > CRM_Utils_PagerAToZ::getDynamicCharacters(Object(CRM_Contact_Selector),
  > FALSE)
  > #17 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/PagerAToZ.php(52):
  > CRM_Utils_PagerAToZ::createLinks(Object(CRM_Contact_Selector), NULL,
  > FALSE)
  > #18 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Search.php(839):
  > CRM_Utils_PagerAToZ::getAToZBar(Object(CRM_Contact_Selector), NULL)
  > #19 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Search/Builder.php(414):
  > CRM_Contact_Form_Search->postProcess()
  > #20 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(447):
  > CRM_Contact_Form_Search_Builder->postProcess()
  > #21 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Refresh.php(75):
  > CRM_Core_Form->mainProcess()
  > #22 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203):
  > CRM_Core_QuickForm_Action_Refresh->perform(Object(CRM_Contact_Form_Search_Builder),
  > "refresh")
  > #23 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103):
  > HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Search_Builder), "refresh")
  > #24 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351):
  > HTML_QuickForm_Page->handle("refresh")
  > #25 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309):
  > CRM_Core_Controller->run((Array:4), (Array:0))
  > #26 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84):
  > CRM_Core_Invoke::runItem((Array:13))
  > #27 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52):
  > CRM_Core_Invoke::_invoke((Array:4))
  > #28 /home/coloradomaker/www/www/wp-content/plugins/civicrm/civicrm.php(1246):
  > CRM_Core_Invoke::invoke((Array:4))
  > #29 /home/coloradomaker/www/www/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
  > #30 /home/coloradomaker/www/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
  > #31 /home/coloradomaker/www/www/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
  > #32 /home/coloradomaker/www/www/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
  
  **Tags:** upgrade, database, search-builder, 5.0
  
  > **Comments:**
  > **username_1**: Or rerun your group cache rebuild since i see "Unknown > column 'civicrm_group_contact.status'" in your error  
  > **username_0**: I assume you mean removing all files in my template_c directory.  Will give it a try...be back as it takes awhile.  
  > **username_0**: While waiting...I checked my *Clean-up Temporary Data and Files* scheduled job and it ran with no errors.  It executes hourly.  
  > **username_0**: After deleting all files under the templates_c directory, I went to *Administer > System Settings > Cleanup Caches and Update Paths* and selected *Cleanup Caches* then *Reset Paths*. Same DB Error using the same Search Builder query above.  
  > **username_0**: While in the Scheduled Jobs area decided to run some of them related to cache and updates.  The following finished execution with Success (1):  *Update Check* and *Disable expired relationships*.  
  > **username_0**: In following some of the steps on the System Administrator / Troubleshooting section under Rebuilding triggers I executed the following URL but still did not fix:  http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2F%25menu%2F%25rebuild%3Freset%3D1&triggerRebuild=1  
  > **username_0**: I decided to also run the *Rebuild Smart Group Cache* Scheduled Job and it finished execution with Success (1),  
  > **username_0**: Ran the *Clean-up Temporary Data and Files* job manually. The Full message:  Finished execution of Clean-up Temporary Data and Files with result: Success (empty values!)  
  > **username_0**: BTW, I am able to go to *Contacts > Manage Groups* and get a list of groups.   When I click on a group it does display the contacts in the group.  Also, I am able to use a Profile that has all my subscription groups (set to *Expose Publicly*), make changes to the groups that I'm subscribed to and save with no errors.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_2 on 2018-05-08. Score: 2
  
  It should be fixed in the latest rc (5.2) <https://download.civicrm.org/latest>
  
  From username_0:
  Was able to install the latest at this time, 5.1.2, and I am now able to query with the Search Builder for groups for the situation that was mentioned above.
  
  > **Comments:**
  > **username_2**: Also note - this affects sites with mysql mode FULL GROUP BY enabled - you can disable that mode in your sql config  
  
  ---
  
  ### Answer by username_3 on 2018-05-07. Score: 1
  
  This may be a bug in 5.0.0. The Drupal Demo site (and our 5.0.0 + Drupal 7 site) fails with a similar message if you try to do a search builder search for Contacts > group = or <>. In our site, the error message also involves 'civicrm\_group\_contact.status' as an unknown field. Naturally, I can't see the log in the demo site, but the error reported on screen is the same.
  
  I don't know how to post a bug... but hope this might help raise one!
  (I tried going to the issue tracker, but it's been moved to git hub and I couldn't spot how to report a bug there.)
  
  > **Comments:**
  > **username_3**: I just tried this on our recently updated 5.0.2rc and same behaviour.  
  > **username_0**: username_3, you aren't on rc 5.2, correct? You indicated 5.0.2rc..same as my version.  username_2 indicated a few minutes ago that this was fixed in 5.2.  I will be out all day tomorrow and not willing to do the change the day before, but willing to give it a go later this week.  
  > **username_3**: Yes, I am on 5.0.2rc. And there is indeed a bug associated with this behaviour - at least in our case: https://lab.civicrm.org/dev/core/issues/106.  I believe it has been fixed for 5.2rc.  
  
  ---
  
  ### Answer by username_4 on 2018-04-27. Score: 0
  
  If logging is enabled, try disabling logging and re-enabling logging. I had a somewhat similar error, but it's different enough that it may not be the same issue.
  
  > **Comments:**
  > **username_0**: I tried this (+ resetting session) before posting.  Thanks for helping me remember though, so others will know.  ;-)  
  
  ---
  
  ### Answer by username_5 on 2018-04-30. Score: 0
  
  This may be related to [my issue too](https://civicrm.stackexchange.com/questions/24678/how-to-search-for-all-contacts-without-a-tag-registered-for-event) - in the meantime, i found (due to the great answer Jon gave) that doing search -> custom search -> include / exclude search - I was able to get the results I wanted.
  
  
  ---
  
  