I am facing an issue with where the table structure is as below
SHIPMENT_GID || COST_TYPE || COST
12233 ||B ||1180
12234 ||B ||1300
12235 ||B ||1100
12236 ||B ||1400
12233 ||B ||200
12233 ||A ||300
Here I want is the SQL query should fetch me unique shipment Id that has Count(cost_type = B) >1
I had the following query but it is not working
select * from shipment_cost where shipment_gid = (select SHIPMENT_GID
from shipment_cost
where (count(COST_TYPE = 'B')>1)