• Using concat function or regular matching in MySQL to quickly generate SQL statements for execution in batches


    Background introduction Today, we need to supplement data in a table according toDimensions of rowsFor update, if it is individual data, you can write the update statement directly, but what the scenario requires isUpdate the data of the whole tableIn order to achieve this requirement, we can’t rely on brute force alone. We need a […]

  • Laravel framework access sentry and send error to pin


    PHP project laravel framework or lumen framework access sentry, which is divided into the following steps 1. Set up sentry background (omitted) 2. Log in to sentry background and register a new project 3. Open the laravel project 3.1 implementation composer require sentry/sentry-laravel 3.2 add a registration statement in bootstrap / app.php: $app->register(\Sentry\SentryLaravel\SentryLumenServiceProvider::class); 3.3 add […]

  • MySQL password is correct but cannot log in locally – 1045 access denied for user ‘root’ @ ‘localhost’ (using password: Yes


    MySQL password is correct but cannot log in locally The error is reported as follows: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES) resolvent:1. Add the skip password problem method in the parameter of starting MySQL as follows:vim /etc/my.cnfAdd skip grant tables under [MySQL],This is used to skip the password problem, but […]

  • PDO data object in PHP


    PDO: PHP data object: the data object of PHP.PDO is a database operation tool class!1. It can operate many kinds of databases, such as mysql, Oracle, Sybase….2. It has more functions to operate the database, such as transactions.3. It can operate all kinds of data, but it has the same syntax: that is to use […]

  • Creating SQL statements dynamically for Oracle and MySQL


    MYSQL: @Query(value = “select * from project_demand where project_id=?1 and if(?2!=”,demand_id in (select demand_id from demand_user where user_id=?2),1=1)”,nativeQuery = true) If (? 2! = ‘, demand_id in (select demand_ Oracle: DECODE(VALUE,IF1,THEN1,IF2,THEN2,IF2,THEN2,..,ELSE) Indicates that if the value is equal to IF1, the result of the decode function returns then1,… Or else if it is not equal […]

  • Python 3 operates MySQL database


    Operating MySQL database in Python 3 To use MySQL database in Python 3, you need to install the MySQL Library pip install pymysql Operation MySQL Guide bag import pymysql Step 1: open the database connection DB = pymysql.connect (host = database address), User = “user name”, Password = “password”, Port = “port”, Database = “database […]

  • [20191213] invalid bind_award prompt under toad 12.txt


    [20191213] invalid bind_award prompt under toad 12.txt –//Link to http://blog.itpub.net/267265/viewspace-2130781/ test, and find the test error at that time. Check again if you have time 1. environment:[email protected]> @ ver1PORT_STRING                    VERSION        BANNER—————————— ————– ——————————————————————————–x86_64/Linux 2.4.xx       Oracle Database 11g Enterprise Edition Release – 64bit Production create table t as select rownum id ,lpad(‘x’,100,’x’) name ,lpad(‘1’,1) […]

  • Inner join on will filter out the conditions of null values on both sides


    During the work of the previous two days, I met a problem. As for the join on query, I have always been confused about the results. Here is a record. 1. First, look at the following SQL query statement: The result is 25053 2. Add a condition of o.lat = n.lat: The result is 15586 […]

  • The method of executing SQL statement in Jenkins project


    Preface In many Jenkins projects on the Internet, SQL files are called based on shell or batch processing to execute SQL commands. Most of them need to be completed based on SQL files. Therefore, when the SQL statements change, you need to go to the Jenkins server to modify the corresponding SQL files or replace […]

  • See through interface abstraction and factory


    Preface I’m going to take you through a new way to understand what interface polymorphism is. Many people, including me, feel helpless when they first learn this thing. They can’t understand it. They can’t understand it. They just know how to write interfaces, and then they won’t be useful. I’ll show you how to understand […]

  • Commonly used SQL


      Summarize the most commonly used SQL statements   1. Special date SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE())+1,0) SELECT DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0) SELECT DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0) SELECT DATEADD(dd,-1,DATEADD(mm,DATEDIFF(mm,0,GETDATE())+1,0)) SELECT DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0) SELECT DATEADD(dd,-1,DATEADD(yy,DATEDIFF(yy,0,GETDATE())+1,0))   2. String processing SELECT LTRIM(col1),RTRIM(col2),LTRIM(RTRIM(col3)) FROM tableName SELECT SUBSTRING(col1,3,2) ,STUFF(col2,3,2,”) ,STUFF(col3,3,2,’XXX’) ,REPLACE(col4,’old’,’new’) FROM tableName Select stuff ((select ‘,’ + col1 from tablename where filter condition for XML path […]

  • Building chat robot with machine learning (3)


    This article is the third in the series of building chat robots with machine learning. By reading this article, you will have a general idea about the realization of chat robots. What features will our chat robots have? Users can express their intention in the way of human natural language. Online incremental learning can be […]