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 8567831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:58:15+00:00 2026-06-11T17:58:15+00:00

What I’m trying to accomplish here didn’t seem all too difficult, and in execution

  • 0

What I’m trying to accomplish here didn’t seem all too difficult, and in execution I don’t see anything I’m doing wrong, but I’m getting some results that should negated from the result set.

I’m writing this on my phone so please excuse me while I write this stuff out by hand:

The table is called “requests”, and in the program people can sign up to accept a request. A specific request by the client is to hide from users that have already accepted a request.

Here’s the catch 22:
A request is based off a specific entity from another table, and one can post multiple requests per base entity. Basically removing duplicates of said entity from the system, and I figured a decent way to handle this is to have a new associative row known as a request which contains a unique id, the account id of the requestor, the entity id of the entity the request is based on, a account id field for the acceptor of that particular row of available requests.

As you can see it starts getting a bit messy in explanation but please keep in mind that this is a pretty late change and can’t afford to change the system around at this stage.

So here’s the query as I best remember:

SELECT
*
FROM
requests
WHERE
completed = 0 AND
entity_id != ANY (SELECT GROUP_CONCAT(entity_id) WHERE accepted_account_id = ‘8’)

8 is my account ID in the system, there are 8 base entities in the system (all posted from the same account, 7) with 2 of those entities having requests based off of them, the first has 4 requests, and the second has 16 requests. So 20 request rows in the requests table.
As a user, I have accepted a single request on both entities in the system. So on two rows in the requests table,
RequestID of 1 with Entity ID 1 with Acceptor Account ID of 8
And
RequestID of 5 with Entity ID 3 with Acceptor Account ID of 8

while all other rows contain a null field for acceptor_account_id

I am trying to simply negate whole entity_ids from the result set, so as not to mess up the pagination going on in the same query (I’m not interested in separating the query, I’m 150% positive this can all be done in one query)

Please if anyones got any questions, please let me know, as this is urgent 🙁

  • 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-11T17:58:16+00:00Added an answer on June 11, 2026 at 5:58 pm

    SELECT * FROM requests WHERE completed = 0 AND entity_id NOT IN (SELECT entity_id WHERE accepted_account_id = '8' GROUP BY entity_id)

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I have a text area in my form which accepts all possible characters from

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.