We have a MySQL specific forum where I move this topic.

]]>

This forum is dedicated to Oracle RDBMS; not MYSQL.

consider http://forums.mysql.com instead]]>

I just want to know that Can I display deptno without grouping along with sum(sal)from emp table ? I mean I want to show the deptno without grouping them but I also want to show the Sum(sal). The sum of salary should be displayed in only first row.

SELECT deptno,

Sum(sal)

FROM emp

GROUP BY deptno;

I know the output of above query. But I want to show all the deptno. I don't want to aggregate deptno but at the same time I want to sum(sal)and its sum should be displayed in first row only. The output should be like this:

Deptno Sum(sal)

10 15000

20

30

40

20

30

10

20

]]>

]]>

SELECT s_order_details.ordernumber, Group_concat(s_order_details.name SEPARATOR '/'), Group_concat(s_order_details.price SEPARATOR '/'), s_order.currency, Sum(s_order_details.quantity), Sum(s_order_details.price * s_order_details.quantity), Group_concat(s_order_details.articleordernumber SEPARATOR '/'), s_order.invoice_shipping, s_order.invoice_shipping + Sum(s_order_details.price), Concat_ws(' ', s_order_shippingaddress.firstname, NULL, s_order_shippingaddress.lastname), s_order_shippingaddress.street, s_order_shippingaddress.zipcode, s_order_shippingaddress.city, s_order_shippingaddress.company, Concat_ws(' ', s_order_billingaddress.firstname, NULL, s_order_billingaddress.lastname), s_order_billingaddress.street, s_order_billingaddress.zipcode, s_order_billingaddress.city, s_order_billingaddress.company, s_order_billingaddress.phone FROM s_order_details INNER JOIN s_order_shippingaddress ON s_order_details.orderid = s_order_shippingaddress.orderid INNER JOIN s_order_billingaddress ON s_order_details.orderid = s_order_billingaddress.orderid INNER JOIN s_order ON s_order.ordernumber = s_order_details.ordernumber WHERE s_order_details.ordernumber = 20005 GROUP BY s_order_details.ordernumber

So please help us to help you if you want to be helped.

]]>