Category: SQL
-
Post Views: 21 1. In Yii 2.0, create a primary key column based on database migration. $this->primaryKey() is used by default. The created primary key column is int(11) by default. as shown in Figure 1 2. Some colleagues plan to create a primary key column of type VARCHAR(32). as shown in Figure 2 3. Method primaryKey() only supports passing in…
-
Post Views: 19 1. In the channel release, an error is reported: sqlstate[01000]: Warning: 1265 data truncatedPUB_LOG_CODEat row 1. as shown in Figure 1 2. SQL error, the root is the table: cpa_pre_pub_log field: pub_log_code type: int(11), but the inserted value is a string: 42s22. as shown in Figure 2 3. Value: 42s22 is taken from: $e->getCode(). as shown in…
-
Post Views: 15 1. Request parameter: filter[and][0][or][0][title][like]=\, the generated sql is as follows, the search result is empty. as shown in Figure 1 2. Check the value of the field title in the table plan, one of the records exists \. In theory, it is possible to query a record. as shown in Figure 2 3. Execute SQL in Navicat…
-
Post Views: 14 1. Mysql error: 1055 – expression #2 of select list is not in group by clause and contains nonaggregated columnmodel.group_idwhich is not functionally depend on columns in group by cluse; as shown in Figure 1 2. Execute the first SQL clause, no error is reported, and the query result is empty. as shown in Figure 2 3.…
-
Post Views: 16 1. Interface response to SQL error: SQLSTATE[42000]: Syntax error or access Violation: 1064 you have an error in your SQL syntax; check the manual that Corresponds to your MySQL Server version for the right syntax to use near6. as shown in Figure 1 2. Remove the request parameter: filter[and][0][or][1][keyword][fis]=, the response is 200, and no error is…
-
Post Views: 19 1. When the container is upgraded for the first time in Rancher, the database migration will be repeated, and then the error will be reported to the upgrade failure. as shown in Figure 1 2. It has been determined that the database structure has not been manually modified. Analyze the health check of the container. Periodically make…
-
Post Views: 17 1. Migrate data from the CSP database to the Cloud database. `channel-pub-api-csp`.`cpa_channel_app_source`. Query 95 records. as shown in Figure 1 2. `channel-pub-api-cloud`.`cpa_channel_app_source`. A total of 158 records were queried. as shown in Figure 2 3. Migrate data from the CSP database to the Cloud database. Field value changes: id, insert `channel-pub-api-cloud`.`cpa_channel_app_source`. Edit command line scripts. /console/controllers/migrate20210425controller.php 4.…
-
Post Views: 13 1. The comments of the table are garbled. as shown in Figure 1 2. The comments of the fields are garbled. as shown in Figure 2 3. The values in the table are garbled. as shown in Figure 3 4. Add at the beginning of the sql file: set names utf8mb4; 5. Table comments, field comments, and…
-
Post Views: 17 1. Expect the generated SQL statement, as shown in Figure 1 2. LIKE: The first operand should be a field name or dB expression, and the second operand can make a string or an array, representing the value of the first operand that needs to be fuzzy. For example,[‘like’, ‘name’, ‘tester’]will generate name like%tester%. If the range…