add_action('wp_ajax_wpcf7_rescanned_form', 'wpcf7_rescanned_form');
add_action('wp_ajax_nopriv_wpcf7_rescanned_form', 'wpcf7_rescanned_form');
function wpcf7_rescanned_form() {
update_option( 'my_option', 'my_value' );
}
add_filter( 'wpcf7_before_send_mail', 'fl_wpcf7_before_send_mail_function' );
function fl_wpcf7_before_send_mail_function( $contact_form ) {
$my_value = get_option( 'my_option' );
}
select
t3.id,
t3.Customer,
t3.weight,
t4.others
from
(
select
t1.id,
t1.Customer,
t2.weight
from Order t1
inner join
(
select
Order_id,
sum(Weight) as weight
from Order_position
group by Order_id
) t2 on t2.Order_id = t1.id
) t3
inner join
(
select
Order_id,
sum(Price * Value) as others
from Order_other
group by Order_id
) t4 on t4.Order_id = t3.id
select
t3.Continent,
t3.Region,
sum(t3.Countries),
sum(t3.LifeDuration),
sum(t3.Population),
sum(t3.Cities),
sum(t4.Languages)
from
(
select
t1.Code,
t1.Continent,
t1.Region,
t1.Countries,
t1.LifeDuration,
t1.Population,
t2.Cities
from
(
select
Code,
Continent,
Region,
count(Name) as Countries,
ROUND(AVG(LifeExpectancy), 2) as LifeDuration,
SUM(Population) as Population
from country
group by Code,Continent,Region
) t1 left join
(
select
CountryCode,
count(Name) as Cities
from city
group by CountryCode
) t2 on t2.CountryCode = t1.Code
) t3 left join
(
select
CountryCode,
count(Language) as Languages
from countrylanguage
) t4 on t4.CountryCode = t3.Code
group by t3.Continent,t3.Region
SELECT
t1.YEAR,
t1.MONTH,
((t1.REGS - t2.REGS) / t1.REGS) * 100 as DYNAMIC
FROM
(
SELECT
EXTRACT(YEAR FROM created_at) as YEAR,
EXTRACT(MONTH FROM created_at) as MONTH,
COUNT(*) AS REGS
FROM users
GROUP BY EXTRACT(YEAR FROM created_at), EXTRACT(MONTH FROM created_at)
) t1
LEFT JOIN
(
SELECT
EXTRACT(YEAR FROM created_at) as YEAR,
EXTRACT(MONTH FROM created_at) as MONTH,
COUNT(*) AS REGS
FROM users
GROUP BY EXTRACT(YEAR FROM created_at), EXTRACT(MONTH FROM created_at)
) t2 ON t2.YEAR = t1.YEAR
AND t2.MOUNT = (t1.MOUNT) + 1
ORDER BY t1.YEAR,t1.MONTH;
select
user_id,
date,
SUM(CASE WHEN currency = 'USD' THEN amount ELSE 0 END) AS USD,
SUM(CASE WHEN currency = 'EUR' THEN amount ELSE 0 END) AS EUR
FROM Table1 AS
GROUP BY user_id, date
SUM( IF(currency = 'USD', amount, 0) ) AS USD,
SUM( IF(currency = 'EUR', amount, 0) ) AS EUR