Hi guys
i have 2 problem
first,
how could i create this view as a decimal on the total_miss field
[HTML]CREATE VIEW miss AS SELECT name, SUM(missing) AS total_miss FROM data where month (date) = 04 group by name;[/HTML]
second,
when i'm in the mysql's shell this line works well, but i could make the the php's code...
[HTML]select e.name, e.salario, a.total_adv,...
User Profile
Collapse
-
thanks... i was using create table because on the mysql's shell works ok....
thanks a lot -
Create a temporary table using php
Hi guys,
i would like to make
create temporary table pagamentos SELECT d.name, SUM(advanced) AS total_advance, f.salario FROM data d JOIN empregados f ON f.name = d.name where MONTH(d.date) = 04 group by name;
and after select all
select * from pagamentos;
in a php script... could someone help me???
thanks
Danylo Iamaguchi -
create a temporary table
hi guys,
how could i create and send this
[HTML]SELECT d.name, d.missing, f.salario, (SELECT SUM(advanced) FROM data d2 WHERE d.name=d2.name) AS AdvanceSum from data d JOIN empregados f ON f.name = d.name where MONTH(d.date) = 4 group by name;[/HTML]
to a temporary table??
i have to add this select in a temporary table and make a calculation between the sum(advanced) and the f.salario but i have no idea of how... -
why does it not work?????Code:"SELECT name, SUM(advanced) AS total_advance FROM data GROUP BY name where MONTH(date) = 04";
Leave a comment:
-
Sum function
Hi Guys,
this is my table
mysql> select * from data;
+------------+-----------------------------+---------+----------+
| date | name | missing | advanced |
+------------+-----------------------------+---------+----------+
| 2007-04-05 | Abraao | 2 | |
| 2007-04-06 | Adeilson Sousa | | 50,00... -
SUM function 2 different fields in 2 tables
Hi guys,
I am trying to sum the values of two fields in 2 tables check by the name of the people in mysql, i'm not sure how to get the SUM function to make this work.
Danylo -
sorry, i forgot tell that i have to check the name as well before sum the values...
thanks
DanyloLeave a comment:
-
Hi guys,
i have the same problem but the fields are in a diffenret table, could u help me please????Leave a comment:
No activity results to display
Show More
Leave a comment: