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

  • SEARCH
  • Home
  • 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 8221599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:58:50+00:00 2026-06-07T13:58:50+00:00

UPDATE: Below is my query: $questionquery = SELECT q.QuestionId, q.QuestionContent, o.OptionType, q.NoofAnswers, GROUP_CONCAT(an.Answer ORDER

  • 0

UPDATE:

Below is my query:

   $questionquery = "
SELECT q.QuestionId, q.QuestionContent, o.OptionType, q.NoofAnswers, GROUP_CONCAT(an.Answer ORDER BY an.Answer SEPARATOR ' ') AS Answer, r.ReplyType, 
       q.QuestionMarks 
  FROM Answer an 
  INNER JOIN Question q ON q.AnswerId = an.AnswerId
  JOIN Reply r ON q.ReplyId = r.ReplyId 
  JOIN Option_Table o ON q.OptionId = o.OptionId 
      WHERE ".implode(" AND ", array_fill(0, $numTerms, "q.QuestionContent LIKE ?"))."
      GROUP BY q.QuestionId, q.SessionId, q.QuestionContent, o.OptionType, q.NoofAnswers, Answer, r.ReplyType, q.QuestionMarks
      ORDER BY ".implode(", ", array_fill(0, $numTerms, "IF(q.QuestionContent LIKE ?, 1, 0) DESC"))."
    ";

The above query will provide a search on a string and output the rows which contains that string under the “Question” column.

I have a URL you can access on my application, please follow the steps below in order to use the application:

  • Step 1: When you open application, you see a green plus button on the
    page, click on it and it will display a modal window.
  • Step 2: In modal window there is a search bar, type in “AAA” and
    submit search, you will see a bunch of rows appear.

Now as you can see if you read carefully there are some rows which re exact duplicates, as in having the exact same content within each column (same question, answer, marks, number of replies etc all the same)

This is what I want to get rid of. I don;t want it to show duplicate rows but to simply just show one of those rows so it doesn’t output duplicate row. What do I need to change?

  • 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-06-07T13:58:52+00:00Added an answer on June 7, 2026 at 1:58 pm

    To not show duplicate rows, unless I’m missing something, you just need to add the DISTINCT clause, like this:

    $questionquery = "
    SELECT DISTINCT q.QuestionId, q.QuestionContent, o.OptionType, q.NoofAnswers,
        GROUP_CONCAT(an.Answer ORDER BY an.Answer SEPARATOR ' ') AS Answer, r.ReplyType, 
        q.QuestionMarks 
    FROM Answer an 
    INNER JOIN Question q ON q.AnswerId = an.AnswerId
    JOIN Reply r ON q.ReplyId = r.ReplyId 
    JOIN Option_Table o ON q.OptionId = o.OptionId 
    WHERE ".implode(" AND ", array_fill(0, $numTerms, "q.QuestionContent LIKE ?"))."
    GROUP BY q.QuestionId, q.SessionId, q.QuestionContent, o.OptionType, q.NoofAnswers, Answer, r.ReplyType, q.QuestionMarks
    ORDER BY ".implode(", ", array_fill(0, $numTerms, "IF(q.QuestionContent LIKE ?, 1, 0) DESC"))."
    ";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NOTE: I added my new solution at the UPDATE answer below. I try to
Below query is used to find min price of the product I update my
When the SQL query below is executed: UPDATE shop_category SET name = 'Secolul XVI
I am trying to fire Update Query using cfquery like below <cfquery name =
i echoed the query below: (query is safe) UPDATE otelozellik SET isim_tr='test', aciklama_tr='<p>test1</p>', uyari_tr='test',
How can I execute the results of my select query. The query below gives
I use the query below: update ACCOUNT_EXTERNAL_IDS set EXTERNAL_ID = 'username:vietnt' where ACCOUNT_ID='1000000' and
postgreSQL question...I have an update query below which updates a column with the results
i am using below query to update my all records but it starts update
The below query returns me two rows: SELECT DocList.DocListId, RegistrationDocList.RegistrationDocListId, Registration.RegistrationId FROM DocList INNER

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.