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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:29:08+00:00 2026-06-12T12:29:08+00:00

i wrote this query, but it gives me an error: select c.sid from catalog

  • 0

i wrote this query, but it gives me an error:

select c.sid
from catalog c
where exists ((select p.color from parts p)
except (select p2.color from parts p2 where p2.color != 'Red'));

ORA-00907: missing right parenthesis

can you tell me where is incorrect?

catalog:

   SID        PID       COST

     1          3         .5
     1          4         .5
     1          8       11.7
     2          3        .55
     2          8       7.95
     2          1       16.5
     3          8       12.5
     3          9          1
     4          5        2.2
     4          6 1247548.23
     4          7 1247548.23

parts:

   PID PNAME                               COLOR

     1 Left Handed Bacon Stretcher Cover   Red
     2 Smoke Shifter End                   Black
     3 Acme Widget Washer                  Red
     4 Acme Widget Washer                  Silver
     5 I Brake for Crop Circles Sticker    Translucent
     6 Anti-Gravity Turbine Generator      Cyan
     7 Anti-Gravity Turbine Generator      Magenta
     8 Fire Hydrant Cap                    Red
     9 7 Segment Display                   Green
  • 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-12T12:29:09+00:00Added an answer on June 12, 2026 at 12:29 pm

    i want to know sid of suppliers who supply only red parts

    You can write:

    SELECT c.sid
      FROM catalog c
      JOIN parts p
        ON p.pid = c.pid
     WHERE p.color = 'Red'
    MINUS
    SELECT c.sid
      FROM catalog c
      JOIN parts p
        ON p.pid = c.pid
     WHERE p.color <> 'Red'
    ;
    

    The part before the MINUS finds all the suppliers who supply red parts; the part after the MINUS finds all the suppliers who supply non-red parts; so, the whole query finds all distinct suppliers who supply only red parts.

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

Sidebar

Related Questions

I wrote a query in this format.. Select * INTO #xyz FROM () which
I wrote a package to query rows from a table. This select query will
I wrote this query: INSERT INTO KeysTable (KeyText, Id) SELECT KeyText as BKT, KeysTable.ID
this works on phpmyadmin , but gives me and error when I am using
I am trying to write a query that joins another table, but in this
Is it possible to write this query in codeigniter active records? $Main_Nav_Query = mysql_query(SELECT
In MySQL, I have a simple "SELECT * FROM foo" query. I would like
if for example this query returns a table name called invoice : select table_name
i have this stored procedure, doing a select query with couple of inner joins
I have this: var field = query(form#+form.id+ input[name=' + error.field + ']); if(field.length){ if(

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.