0

Hi. I am stumped when trying to figure out how to make it so the name in one column is just listed once with nulls values underneath until the next column name. I'm sorry if I don't explain this right.

I have this script:

SELECT NAME, SELLPRICE "Price Sold", COSTPRICE "Product Cost", ROUND( (SUM(SELLPRICE)  - SUM(COSTPRICE))*100 / SUM(SELLPRICE)) as "% Profit"
FROM GS_SALES , GS_CUSTOMER
where GS_CUSTOMER.CUSTID = GS_SALES.CUSTID
GROUP BY CITYID,NAME, SELLPRICE, COSTPRICE
ORDER BY CITYID;

which seems to give me the right results except that I want null values under the name field in the name colmn after a name is listed once and until it gets to the next unique name. Also if my script above looks off, please let me know.
Thank you. :)

Edited by Nick Evan: Added CODE tags

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by debasisdas
0

I don't know what you are saying. So this can't be done in SQL statements?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.