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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:14:46+00:00 2026-06-12T05:14:46+00:00

Hello i’ve the following SQL query Select catalogid , numitems, allitems – numitems ignoreditems

  • 0

Hello i’ve the following SQL query

 Select catalogid , numitems, allitems - numitems ignoreditems
        from ( 
        select i.catalogid,
         sum(case when (ocardtype in ('PayPal','Sofort') OR
                        ocardtype in ('mastercard','visa') and
                        odate is not null) then numitems
                        else 0 end) numitems,
         sum(numitems) allitems 
        from orders o
        join oitems i on i.orderid=o.orderid
        join products T1 on T1.catalogid = i.catalogid
        group by i.catalogid
        ) X 

in the last join statement table products contains 8 columns and they don’t show in the result query, i can only see the columns catalogid, numitems and ignoreditems, so what am i doing wrong, if i have to select those columns in order to make them appear how can i do it with this syntax?

  • 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-12T05:14:47+00:00Added an answer on June 12, 2026 at 5:14 am
    Select catalogid , numitems, allitems - numitems ignoreditems, X.c1,X.c2,X.c3,X.c4,X.c5,X.c6,X.c7,X.c8
        from ( 
        select i.catalogid,
         sum(case when (ocardtype in ('PayPal','Sofort') OR
                        ocardtype in ('mastercard','visa') and
                        odate is not null) then numitems
                        else 0 end) numitems,
         sum(numitems) allitems ,
         T1.c1, T1.c2, T1.c3, T1.c4, T1.c5, T1.c6, T1.c7, T1.c8
        from orders o
        join oitems i on i.orderid=o.orderid
        join products T1 on T1.catalogid = i.catalogid
        group by i.catalogid, T1.c1, T1.c2, T1.c3, T1.c4, T1.c5, T1.c6, T1.c7, T1.c8
        ) X 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everyone how can I get two values from different select boxes? I get
Hello again ladies and gents! OK, following on from my other question on ASP.NET
Hello The following procedure will have to move all constraints from one table to
Hello I've got this query to get users by email, which is an unique
Hello I have following column in SSRS Report. Column Name(Title) Mehta, Natasha(18)----its Title+(count) value
Hello I want to get Accurate location so that i have used following link
Hello everybody, I'm stuck with a Doctrine join query. The system continues telling me
Hello I'm trying to add the select-all, cut, copy and paste command in my
Hello guys i am trying attempt a dynamic select here. as soon as i
Hello I have the following script in PHP: $correct = array(a, a, a, a);

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.