Answer the question
In order to leave comments, you need to log in
Should I change host in robots after moving from http to https?
Hello, the situation is as follows. The site was moved from http to https.
Redirect set up.
But they missed the host directive. It has remained unchanged - host: site.ru
A couple of months have passed.
Is it possible to change the host to https://site.ru now? Will there be consequences?
(By the way. In the google webmaster panel for http site, 80 percent of the pages are excluded as pages with redirects, some are blocked by robots, etc., and 15 percent in the report without errors, and the number is still growing, but the last crawl dates are in November and earlier, about 70,000 pages in total).
Answer the question
In order to leave comments, you need to log in
MySQL:
SELECT T.YEAR,
SUM (CASE WHEN T.W = 1 THEN 1 ELSE 0 END) AS MEN,
SUM (CASE WHEN T.W = 2 THEN 1 ELSE 0 END) AS WOMEN
FROM (SELECT (YEAR(CURRENT_DATE) - YEAR(F.DR)) DIV 10 * 10 AS YEAR, F.W
FROM DB_PERSON AS P LEFT JOIN DB_PERSON_FIO AS F ON P.ID = F.ID_PERSON
WHERE P.STAT > 0) AS T
GROUP BY T.YEAR
ORDER BY T.YEAR;
SELECT T.YEAR,
SUM (CASE WHEN T.W = 1 THEN 1 ELSE 0 END) AS MEN,
SUM (CASE WHEN T.W = 2 THEN 1 ELSE 0 END) AS WOMEN
FROM (SELECT (DATE_FORMAT(FROM_DAYS(TO_DAYS(CURRENT_DATE) - TO_DAYS(F.DR)), '%Y') + 0) DIV 10 * 10 AS YEAR,
F.W
FROM DB_PERSON AS P LEFT JOIN DB_PERSON_FIO AS F ON P.ID = F.ID_PERSON
WHERE P.STAT > 0) AS T
GROUP BY T.YEAR
ORDER BY T.YEAR;
MySQL syntax.
Here is the table structure and query. You also need to create an additional table for ages.
CREATE TABLE db_person
(
id integer,
stat integer
);
CREATE TABLE db_person_fio
(
id_person integer,
dr date,
w integer
);
CREATE TABLE db_person_ages
(
age integer
);
INSERT INTO db_person_ages(age) VALUES (0);
INSERT INTO db_person_ages(age) VALUES (1);
INSERT INTO db_person_ages(age) VALUES (2);
INSERT INTO db_person_ages(age) VALUES (3);
INSERT INTO db_person_ages(age) VALUES (4);
INSERT INTO db_person_ages(age) VALUES (5);
INSERT INTO db_person_ages(age) VALUES (6);
INSERT INTO db_person_ages(age) VALUES (7);
INSERT INTO db_person_ages(age) VALUES (8);
INSERT INTO db_person_ages(age) VALUES (9);
INSERT INTO db_person_ages(age) VALUES (10);
SELECT CONCAT(age*11,'-',age*11+10) as descr,
IFNULL(man,0) as man,
IFNULL(woman,0) as woman
FROM db_person_ages ages
LEFT JOIN
(
SELECT FLOOR(timestampdiff(YEAR,f.dr,CURRENT_DATE)/11) as diff,
SUM(CASE WHEN f.w=1 THEN 1 ELSE 0 END) as man,
SUM(CASE WHEN f.w=0 THEN 1 ELSE 0 END) as woman
FROM db_person p, db_person_fio f
WHERE p.id = f.id_person
AND p.stat>0
GROUP BY 1
) t ON ages.age = t.diff
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question