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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:04:36+00:00 2026-06-09T13:04:36+00:00

Below is my query which i’m trying to use, select DISTINCT c.sno from Cards

  • 0

Below is my query which i’m trying to use,

select DISTINCT c.sno from Cards as c, reservation as r 
where c.name='CRS-4-FC' AND c.sno != r.ssno;

This query is supposed to select only those sno from Cards which dont exist in the reservation table ie no sno is present in the column of ssno in reservation table. I put in

c.sno!=r.ssno

so that i dont choose all the sno. But when this query runs i get all the sno rather than those that are not reserved. Can someone help out where im going wrong..

  • 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-09T13:04:37+00:00Added an answer on June 9, 2026 at 1:04 pm

    try

    select DISTINCT c.sno
    from Cards as c 
    left outer join reservation as r on c.sno = r.ssno
    where r.ssno is null
    and c.name='CRS-4-FC'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the query below (which works perfectly), as a subquery
I have a query below which displays these results: SELECT q.QuestionId, q.QuestionContent, an.Answer FROM
I have a result from a query like the below, which does not have
I have the below query in a postgresql database SELECT * FROM accounts where
I'm using the following query which returns the result as below: SELECT subnets.subnet_id ,
I want to group the below query by GetSetDomainName and select the row which
I have below SQL query: SELECT * FROM ( SELECT S.aCol, S.bCol, S.cCol, ROW_NUMBER()
I have a SQL query which retrieve wall post list $qry=mysql_query(SELECT senderid,post,date FROM .post_table.
I have a select query which works correctly with the below output: I would
I have a query which returns the below from joining two tables: +---------------+-----------------+ |

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.