Avatar of joyacv2
joyacv2Flag for Puerto Rico asked on

calculated fields like where inside where

Hi,

I have the following table

TABLES DESCRIPTIONS
The table is in a database table. I need a query that produces the second table, that is a resume of the first table, any idea?
Oracle DatabasePHPMySQL Server

Avatar of undefined
Last Comment
joyacv2

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Sean Stuber

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Sharath S

try this
SELECT CATEGORY,TYPE_P+TYPE_T AS Quantity,TYPE_P,TYPE_T 
  FROM (SELECT *
          FROM test
         PIVOT (COUNT(TYPE1) FOR TYPE1 IN ('P' as TYPE_P,'T' as TYPE_T)) P1) T1

Open in new window

http://sqlfiddle.com/#!4/bcf20/11
ASKER
joyacv2

exactly what I am looking for!!!!
Your help has saved me hundreds of hours of internet surfing.
fblack61