mysql

MySQL Query, problems with with duplicates on insert into

拈花ヽ惹草 提交于 2021-02-11 12:14:06
问题 So I'm using the forum software Xenforo and I need help with a SQL query which will be executed periodically. The forum will have approximately 300-500 active users. So nothing too big. The goal: All users xf_users need to be subscribed to node_id 71 except users which are part of certain user_group_id . Now users can unsubscribe from the forum or change the notify_on and send_alert & send_email fields. I do not want that. So if users 'unsubscribe' they need to be added again. The only

MySQL incorrect datetime value error for valid dates

那年仲夏 提交于 2021-02-11 12:13:01
问题 I have a timestamp column and I get an errors when I try to enter some specific dates and times. For example 2013-03-31 02:13:11 and 2014-03-31 02:55:00 work, but 2013-03-31 02:55:00 says: SQL Error (1292): Incorrect datetime value What could be the problem? 回答1: This could be a daylight saving time issue, especially when you mention that the date causing problem is 2013-03-31 02:55:00 ... the date on which most European countries started observing DST for the year 2013. Central Europe Time

pymysql.err.OperationalError - Lost connection to MySQL server during query

让人想犯罪 __ 提交于 2021-02-11 12:07:43
问题 I am using Python script to insert records into MySQL database table. The script fails with the following error message. MySQL version is 8.0.17 , Python version 3.6.5 (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query ([WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)') (Background on this error at: http:/

pymysql.err.OperationalError - Lost connection to MySQL server during query

筅森魡賤 提交于 2021-02-11 12:04:45
问题 I am using Python script to insert records into MySQL database table. The script fails with the following error message. MySQL version is 8.0.17 , Python version 3.6.5 (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query ([WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)') (Background on this error at: http:/

[mybatis] sql语句无错误,但是执行多条sql语句时,抛出java.sql.SQLSyntaxErrorException

一个人想着一个人 提交于 2021-02-11 11:38:41
错误内容 org .springframework .jdbc .BadSqlGrammarException : ### Error updating database . Cause : java .sql .SQLSyntaxErrorException : You have an error in your SQL syntax ; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ' 553fe0583195819abb6bf1bd2f03d5f32a17f2238f9d23d6c70f67e947e43b33' , ' at line 2 ### The error may involve com .slabs .upload .database .mapper .AgentBillDetailDAO .batchUpdateSealIdByPrimaryKey -Inline ### The error occurred while setting parameters ### SQL : update agent_bill_detail seal_id = ? , is_send = ? , receive_time =

MySQL- optimize case statement

杀马特。学长 韩版系。学妹 提交于 2021-02-11 10:07:26
问题 I have a query with many case statements SELECT case when (std_no like '070%' or std_no like '071%') then 'A' when (std_no like '077%' or std_no like '076%') then 'B' when std_no like '075%' then 'C' when std_no like '072%' then 'D' when std_no like '078%' then 'E' when (std_no not like '07%' and std_no not like '00%' and std_no not like '0100%' and substring(std_no,4,1) in('2','3')) then 'F' when (std_no not like '07%' and std_no not like '00%' and std_no not like '0100%' and substring(std

MySQL- optimize case statement

我们两清 提交于 2021-02-11 10:04:32
问题 I have a query with many case statements SELECT case when (std_no like '070%' or std_no like '071%') then 'A' when (std_no like '077%' or std_no like '076%') then 'B' when std_no like '075%' then 'C' when std_no like '072%' then 'D' when std_no like '078%' then 'E' when (std_no not like '07%' and std_no not like '00%' and std_no not like '0100%' and substring(std_no,4,1) in('2','3')) then 'F' when (std_no not like '07%' and std_no not like '00%' and std_no not like '0100%' and substring(std

Is declare in mysql giving syntax error?

家住魔仙堡 提交于 2021-02-11 09:38:24
问题 I'm new to mysql and I'm trying to create a stored procedure but getting syntax error due to declare a variable. The version of mysql I'm using is 5.5.43 and my procedure is: CREATE PROCEDURE spSearch ( p_ACTION INT, p_PROJECT_CUSTOMER INT, p_PROJECT_NAME VARCHAR(50), p_PROJECT_SALESPERSON INT, p_PROJECT_MANAGER INT, p_PROJECT_PMF INT, p_PROJECT_TYPE INT, p_PROJECT_DESIGNER INT, p_PROJECT_AANDD INT, p_PROJECT_REFD INT, p_PROJECT_VENDOR INT, p_PROJECT_GENERALCONTRACTOR INT, p_PROJECT_PUNCHLIST

mysql select query where date = … not returning data

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 09:38:23
问题 I've view ReportView I want to fetch the result having date 10-Feb-2020 I tried select * from ReportView where date = "10/02/2020"; select * from ReportView where date = date_format("10/02/2020","%d/%m/%Y"); select * from ReportView where date = str_to_date("10/02/2020","%d/%m/%Y"); select * from ReportView where date_format(date,"%d/%m/%Y") = date_format("10/02/2020","%d/%m/%Y"); select * from ReportView where str_to_date(date,"%d/%m/%Y") = str_to_date("10/02/2020","%d/%m/%Y"); select * from

jquery tabledit dropdown: is it possible to retrieve values from mysql database?

感情迁移 提交于 2021-02-11 09:37:07
问题 I'm using the jquery tabledit plug-in to update a database. Works perfectly like in the official examples. I can succesfuly include a static dropdown with a fixed number of options (defined in custom_table_edit.js). I'd like to be able to dynamically get those options from a database instead, but I don't know how to customize the code in custom_table_edit.js. I can code this in php with a loop querying the database and generating a html <select> field. But I don't have knowledge of javascript