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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:50:52+00:00 2026-06-04T07:50:52+00:00

Hi everyone I’m having a problem. I have two SQL queries that are both

  • 0

Hi everyone I’m having a problem.

I have two SQL queries that are both returning different results:

SELECT name, capacity, $price, licensed, cost 
FROM venue, catering WHERE venue.venue_id = catering.venue_id 
AND grade=$grade 
AND capacity >= $minCapacity
AND capacity <= $maxCapacity
AND venue.venue_id 
NOT IN (SELECT venue_id FROM venue_booking WHERE date_booked = $us_date)

as well as

SELECT venue.venue_id,name,capacity,licensed,$price,cost
FROM venue
JOIN catering ON venue.venue_id = catering.venue_id
WHERE capacity BETWEEN '$minCapacity' AND '$maxCapacity' 
AND venue.venue_id NOT IN 
(SELECT venue_id
FROM venue_booking
WHERE date_booked = '$us_date')
AND catering.grade = '$grade' ORDER BY venue.capacity

What is the difference here?

  • 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-04T07:50:53+00:00Added an answer on June 4, 2026 at 7:50 am

    what I am feeling .. main difference is –

    in first query you are checking capacity with condition –

    AND capacity >= $minCapacity
    AND capacity <= $maxCapacity
    

    which will apply as number ..

    but in second query this condition is in range of two string values..

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

Sidebar

Related Questions

everyone The problem is if there exists two exported components which have the same
everyone. I have some labels that I draw them in the xib file, and
Everyone, I am a newbie to android development. Now I have a question that
everyone..i want after i type 0203-ED in textfield ...two character behind that text can
Everyone, I have a WPF app that has a canvas that I have wrapped
everyone. I have problem replacing existing rows in table with new ones. I use
Everyone managing open-source-software runs into the problem, that with the time the process of
everyone. I am new to PHP. I am having this problem with DateTime :
everyone , I have a problem about the API-- alSourceUnqueueBuffers when I use the
everyone seems interested in building IPhone apps today. Do you have to have an

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.