mariadb

MySql Select last row with 30 minutes difference in date

五迷三道 提交于 2020-06-17 11:36:33
问题 This is a followup to this question MySql Select rows with 30 minutes difference in date, albeit similar in concept the solution needed might be different. I have a MySql-8.0/MariaDb-10.4 table that contains a list of site visits of different visitors: I want to create a query that returns the last visit of each visit session , where the session definition is where the CreatedAt date is 30 min or more from the previous visits. So in my case, I should be returning row 7 (Id column), row 12 and

MySql Select last row with 30 minutes difference in date

我怕爱的太早我们不能终老 提交于 2020-06-17 11:35:27
问题 This is a followup to this question MySql Select rows with 30 minutes difference in date, albeit similar in concept the solution needed might be different. I have a MySql-8.0/MariaDb-10.4 table that contains a list of site visits of different visitors: I want to create a query that returns the last visit of each visit session , where the session definition is where the CreatedAt date is 30 min or more from the previous visits. So in my case, I should be returning row 7 (Id column), row 12 and

MySql Select last row with 30 minutes difference in date

你。 提交于 2020-06-17 11:35:26
问题 This is a followup to this question MySql Select rows with 30 minutes difference in date, albeit similar in concept the solution needed might be different. I have a MySql-8.0/MariaDb-10.4 table that contains a list of site visits of different visitors: I want to create a query that returns the last visit of each visit session , where the session definition is where the CreatedAt date is 30 min or more from the previous visits. So in my case, I should be returning row 7 (Id column), row 12 and

MySQL - Why is phpMyAdmin extremely slow with this query that is super fast in php/mysqli?

女生的网名这么多〃 提交于 2020-06-16 19:26:18
问题 Edit : see also my answer, the main difference is the LIMIT that phpmyadmin adds, but I still don't understand and phpmyadmin is still slower than mysqli. On our database (+web) server we have a huge difference in performance when doing a query in phpmyadmin vs doing it from php (mysqli) or directly on the mariadb server. 60 seconds vs < 0.01 seconds! This query functions quite well: SELECT * FROM `TitelDaggegevens` WHERE `datum` > '2020-03-31' AND datum < '2020-05-02' AND `fondskosten` IS

MySQL - Why is phpMyAdmin extremely slow with this query that is super fast in php/mysqli?

强颜欢笑 提交于 2020-06-16 19:21:49
问题 Edit : see also my answer, the main difference is the LIMIT that phpmyadmin adds, but I still don't understand and phpmyadmin is still slower than mysqli. On our database (+web) server we have a huge difference in performance when doing a query in phpmyadmin vs doing it from php (mysqli) or directly on the mariadb server. 60 seconds vs < 0.01 seconds! This query functions quite well: SELECT * FROM `TitelDaggegevens` WHERE `datum` > '2020-03-31' AND datum < '2020-05-02' AND `fondskosten` IS

MySQL - Why is phpMyAdmin extremely slow with this query that is super fast in php/mysqli?

狂风中的少年 提交于 2020-06-16 19:21:12
问题 Edit : see also my answer, the main difference is the LIMIT that phpmyadmin adds, but I still don't understand and phpmyadmin is still slower than mysqli. On our database (+web) server we have a huge difference in performance when doing a query in phpmyadmin vs doing it from php (mysqli) or directly on the mariadb server. 60 seconds vs < 0.01 seconds! This query functions quite well: SELECT * FROM `TitelDaggegevens` WHERE `datum` > '2020-03-31' AND datum < '2020-05-02' AND `fondskosten` IS

mysql feature-scaling calculation

北城余情 提交于 2020-06-16 18:36:35
问题 I need to formulate a mysql query to select values normalized this way: normalized = (value-min(values))/(max(values)-min(values)) My attempt looks like this: select Measurement_Values.Time, ((Measurement_Values.Value-min(Measurement_Values.Value))/(max(Measurement_Values.Value)-min(Measurement_Values.Value))) from Measurement_Values where Measurement_Values.Measure_ID = 49 and Measurement_Values.time >= '2020-05-30 00:00' but is obviously wrong as it returns only one value. Can you help me

mysql feature-scaling calculation

不羁岁月 提交于 2020-06-16 18:35:06
问题 I need to formulate a mysql query to select values normalized this way: normalized = (value-min(values))/(max(values)-min(values)) My attempt looks like this: select Measurement_Values.Time, ((Measurement_Values.Value-min(Measurement_Values.Value))/(max(Measurement_Values.Value)-min(Measurement_Values.Value))) from Measurement_Values where Measurement_Values.Measure_ID = 49 and Measurement_Values.time >= '2020-05-30 00:00' but is obviously wrong as it returns only one value. Can you help me

How do I output a match after comparing two tables? [duplicate]

非 Y 不嫁゛ 提交于 2020-06-13 12:15:34
问题 This question already has an answer here : How do I join two tables and compare them? (I've asked several times, but I couldn't find the answer.) (1 answer) Closed 2 months ago . I want to compare two tables. But I don't know what to do because I'm not good enough. I want to know how to write query no.1_table id chart_num chart_name visit card_amount_received 1 4 user1 2020-04-05 1000 2 5 user2 2020-05-05 1000 3 5 user2 2020-05-05 1000 4 5 user2 2020-06-05 1000 5 6 user3 2020-07-05 1000 6 6

MariaDB - cannot login as root

只愿长相守 提交于 2020-06-10 11:32:53
问题 I am trying to setup MariaDB (10.0.29) on Ubuntu (16.04.02). After I installed it and started the process ( sudo service mysql start ), I cannot login as root even though I originally set the password to blank. Ie mysql -u root will deny me access. I logged in through sudo mysql and checked the user table, ie. select user, password, authentication_string from mysql.user and as expected: +---------+----------+-----------------------+ | User | password | authentication_string | +---------+-----