• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some Oracle SQL help

Tikerz

Golden Member
Here's the query I have now:

select quantity, title, round((cost/retail*100),0) "% Profit"
from orders natural join orderitems natural join books
where (cost/retail*100) < 55;

Here's the output:

QUANTITY TITLE % Profit
-------- ------------------------------ ----------
1 HOW TO MANAGE THE MANAGER 48
1 PAINLESS CHILD-REARING 53
2 PAINLESS CHILD-REARING 53
1 SHORTEST POEMS 55
1 PAINLESS CHILD-REARING 53
1 PAINLESS CHILD-REARING 53
1 PAINLESS CHILD-REARING 53

How do I get it look like this?

QUANTITY TITLE % Profit
-------- ------------------------------ ----------
1 HOW TO MANAGE THE MANAGER 48
6 PAINLESS CHILD-REARING 53
1 SHORTEST POEMS 55


Thank you in advance for any help!
 
Originally posted by: ajpa123
aggregates and order bys

You mean aggregate functions and the group by clause? I thought so, but I don't think I'm using them right. Not sure where to start.
 
Back
Top