Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6616801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:37:36+00:00 2026-05-25T20:37:36+00:00

Hi I am trying to create a search function but having trouble on getting

  • 0

Hi I am trying to create a search function but having trouble on getting it to work.

This is what I have so far:

SELECT DISTINCT users.ID, users.name

FROM users 
INNER JOIN usersSkills 
ON users.ID = usersSkills.userID 
INNER JOIN usersLanguages 

ON users.ID = usersLanguages.userID 
WHERE activated = "1" 
AND type = "GRADUATE" 

AND usersSkills.skillID IN(2) 
GROUP BY usersSkills.userID HAVING COUNT(*) = 1 

AND usersLanguages.languageID IN(2) 
GROUP BY usersLanguages.userID HAVING COUNT(*) = 1 

But I keep getting this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘GROUP BY usersLanguages.userID HAVING COUNT(*) = 1’ at line 14

If i remove one of the inner joins and group bys it works so not sure what it is can i use two group bys?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:37:37+00:00Added an answer on May 25, 2026 at 8:37 pm

    Tr this:

    SELECT DISTINCT users.ID, users.name, COUNT(*)
    FROM users 
    INNER JOIN usersSkills ON users.ID = usersSkills.userID 
    INNER JOIN usersLanguages ON users.ID = usersLanguages.userID 
    WHERE activated = "1" 
          AND type = "GRADUATE" AND usersSkills.skillID = 2 
          AND usersLanguages.languageID = 2 
    GROUP BY usersSkills.userID,
             usersLanguages.userID 
    HAVING COUNT(*) = 1 
    

    Removed the multiple erroneous GROUP BY‘s and merged the query.
    Also changed the IN(x) to = x

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create a new google custom search engine, but when
I'm trying to create a custom search but getting stuck. What I want is
I trying to create a auto-complete search script (jQuery + PHP) but I have
I am trying to create a search page, this allows the admin to search
I'm trying to create a simple search page, but I'm not 100% sure how
I'm trying to create the search form with keyword highlighting, but obviously I won't
Im trying to create a page in which users can search for items on
I'm trying to create a simple search function where a user selects an option
I am trying to get ajax to work, but I keep getting a 403
I'm trying to create pagination for search results using MySQL and ColdFusion. My intention

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.