I have a code I've made but I'd like to hide the column. So that it only shows the storeID instead of the SALARY along with it. I know I need to wrap it around in another set of brackets, but don't know where to do that. Also can anyone tell me a technique to identify where to use the brackets? Sorry, not too familiar with MySQL, but have been learning for couple of weeks now. Just finished the diagrams with Chen Notations, now the codes.
SELECT storeID, SUM(SALARY) FROM STORE
JOIN EMPLOYEE
WHERE SALARY < expenditure;
Currently it's displaying:
| storeID | |    SUM(SALARY)    |
|    1    | |    £30000         |
|    2    | |    £25000         |
|    3    | |    NOTHING        |
I want the second column SUM(SALARY) to be hidden. Thanks in advance.
EDIT: I wasn't being too clear. I needed to calculate the SALARY (sum of all salaries from each store), and find the storeID's with SALARY < expenditure.
EMPLOYEE = SALARY STORE = storeID and expenditure.
SELECT StoreId
FROM
(
   SELECT storeID, SUM(SALARY) FROM STORE
   JOIN EMPLOYEE
   WHERE SALARY < expenditure
)
this should work ;)
try this
    SELECT storeID  FROM STORE
    JOIN EMPLOYEE
    WHERE SALARY < expenditure;
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With