select
t1.property_reg_num,
t1.property_owner_name_id
from property_table t1
inner join
(
select
property_reg_num,
property_owner_name_id,
MIN(property_record_on_year) min_year
from property_table
group by property_reg_num,
property_owner_name_id
) t2 on t2.property_reg_num = t1.property_reg_num
and t2.property_owner_name_id = t1.property_owner_name_id
and t1.property_record_on_year in (t2.min_year, t2.min_year+1, t2.min_year+2)
group by t1.property_reg_num,
t1.property_owner_name_id
select
t2.epoch,
t2.`value`
from
(
select
t1.`value`,
t1.epoch,
(select `value` from data where epoch < t1.epoch ORDER BY epoch DESC LIMIT 1) prev_value,
(select `value` from data where epoch > t1.epoch ORDER BY epoch LIMIT 1) next_value
from data t1
where t1.value = 0
order by t1.epoch
) t2
where t2.prev_value = 0 and t2.next_value = 0
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