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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:52:19+00:00 2026-06-12T03:52:19+00:00

Error: argument of AND must be type boolean, not type character varying SELECT partno,

  • 0

Error: argument of AND must be type boolean, not type character varying

SELECT 
    partno, 
    count(manufacturer) 
FROM 
    components 
WHERE 
    partno IN (SELECT partno FROM productions 
               WHERE 
                    year = 2005
                AND attr is NULL
              ) 
GROUP BY partno
UNION
SELECT 
    partno, 
    count(manufacturer) 
FROM components 
WHERE 
    partno IN (SELECT partno FROM productions 
               WHERE 
                   year = 2005
               AND attr is NULL
              ) 
GROUP BY partno
) 
AND (
        partno NOT IN (SELECT partno FROM components
    )
); 

The part after the union is to include all partno from components that are not in productions (they should be counted as 0)

  • 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-12T03:52:20+00:00Added an answer on June 12, 2026 at 3:52 am

    You have one bracket too many (after the attr IS NULL) and you have an aggregate function (the count in the second part) without a group by. Do you mean this:

    select partno, count(manufacturer) 
    from components 
    where partno in 
    (
       select partno from productions where year=2005 and attr is NULL
    ) 
    group by partno
    
    UNION
    
    select partno, count(manufacturer) 
    from components 
    where partno in 
    (
        select partno from productions where year=2005 and attr is NULL
    ) 
    AND partno not in (select partno from components)
    group by partno; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

getting error: ActiveRecord::StatementInvalid (PGError: ERROR: argument of HAVING must be type boolean, not type
I am getting an error _reverse_with_prefix() argument after * must be a sequence, not
In the following code, I get a compile time error: ByRef Argument type mismatch.
bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- /dbs/supermodels.db: unexpected file type or format') Is this error
I'm getting this error, error CS0182: An attribute argument must be a constant expression,
Ugh, got this unexpected error: Argument 1 passed to QMySqliDatabaseResult::__construct() must be an instance
I am getting error: Invalid argument supplied for foreach() This is my class for
I'm getting the error Invalid argument supplied for foreach() even though the array being
Argument exception error is thrown at the following code. It's a simple code but
I get the following error for the second argument even when I set the

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.