Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mecctro

    How to write a querry sum when condition

    Thanks, I've been at work, tried this and it worked. select product, SUM(CASE WHEN type = 'hotel' THEN sold ELSE 0 END) SUM(CASE WHEN type = 'b&b' THEN sold ELSE 0 END) SUM(CASE WHEN type = 'inn' THEN sold ELSE 0 END) from sales group by product
  2. mecctro

    How to write a querry sum when condition

    There are several problems with that. I read company's base on my work, but they are not happy with me using it so I cant ask for advice. I don't have access to internet from work so I can't be looking for solutions from there. I did search forums, but my English and knowledge of SQL waren't...
  3. mecctro

    How to write a querry sum when condition

    I have a table like this Product type sold beer hotel 20 beer hotel 30 beer inn 20 beer inn 40 coke b&b 20 coke hotel 40 coke hotel 10 and want to get the result like product hotel inn b&b beer 50 60 0 coke 50 0 20 How to write a query (Oracle) Thanks

Part and Inventory Search

Back
Top