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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:55:43+00:00 2026-05-30T03:55:43+00:00

All request records exist within the Request table. They can then be filtered because

  • 0

All request records exist within the Request table. They can then be filtered because some also belong in an additional table, either Booking or Declined. Rooms and vwRoomRequest don’t affect this query.
I’m trying to return records which have been ‘declined’, they therefore exist in both the Requests table AND the Declined table and the primary key of these 2 tables will be the same.

In the real query, I’m using group by Request.RequestID because this query returns 2488 results when there are in fact only 17 rows in the Request table!

The main problem (other than the above), is that this query is returning the same result as if the this line of the query were not there :
AND Request.RequestID<>BookingID AND Request.RequestID<>Declined.RequestID.

SELECT * 
FROM Request , Rooms, Booking, Declined, vwRoomRequest 
WHERE Request.RoomID = Rooms.RoomID 
AND Rooms.RoomID = vwRoomRequest.RoomID
AND Request.RequestID<>BookingID 
AND Request.RequestID<>Declined.RequestID

Any ideas?

  • 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-30T03:55:45+00:00Added an answer on May 30, 2026 at 3:55 am

    If you’re trying to return all requests that have been declined, why not just return all rows from the Declined table and LEFT JOIN in whatever other tables you need? Something like this:

    SELECT * FROM Declined
    LEFT JOIN Request ON Declined.RequestID = Request.RequestID
    LEFT JOIN Rooms ON Request.RoomID = Rooms.RoomID
    LEFT JOIN vmRoomRequest ON Rooms.RoomID = vmRoomRequest.RoomID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to request any records from a table that appear on or after
I need to consume XML based RESTful API. All request are sent in XML
I am using ASP.NET 2.0 C#. I want to redirect all request for my
I need loging all HTTP request (from any application). I have Delphi 7.0. Anybody
From an HTTP request all the way to my files (like .asmx)... what are
I am writing an application where all the request to the internet should go
I'm making a website that tend to handle all the request in one page
I have a client request that all times be displayed in Pacific Time Zone,
OK when I make a request I want all the items with the same
We're using Prototype for all of our Ajax request handling and to keep things

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.