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

The Archive Base Latest Questions

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

I have a very large sql statement I have to make a modification to.

  • 0

I have a very large sql statement I have to make a modification to. In one of the tables there are four int columns and I have to exclude 2 sets. If I just want to exclude the values for one table it is pretty simple, use an except statement. I can do this:

select *
from Table Z
except(
select *
from Table Z
where (A= 2 and B= 10 and C= 3 and D= 90) 
or (A= 2 and B= 17 and C= 100 and D= 90))

However I can’t get it to work using a where statement. I only want those two sets of combinations excluded. In the real statement there is a join with six different tables and all kinds of case statements in the select.

I have tried a few things and nothing seems to work.

Any ideas would be greatly appreciated!

Thanks!

  • 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:38:27+00:00Added an answer on June 4, 2026 at 7:38 am

    Why the complex EXCEPT? Doesn’t this work?:

    SELECT  *
    FROM Table Z
    WHERE NOT (  ( A= 2 and B= 10 and C= 3 and D= 90) 
              OR ( A= 2 and B= 17 and C= 100 and D= 90)
              )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have a very large SQL script and while trying to execute it
I have a very large Oracle database, with many many tables and millions of
I also have a very large table in SQL Server (2008 R2 Developer Edition)
SQL Server 2008. I have this very large query which has a high cost
I have 2 very large tables. I try to figure out what they have
I have a very large table in SQL Server 2008. It has lots of
Is it particularly bad to have a very, very large SQL query with lots
I have a very large (100+ gigs) SQL Server 2005 database that receives a
I have a very large (millions of rows) SQL table which represents name-value pairs
I am using Microsoft SQL Server 2008. I have a very large text file

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.