MySql Delete does not take index problem.

If the delete statement has a query, the wrong way to write will result in no indexing. Simple and crude way: remove two SQL, a query, a delete ======================= 【No index writing. DELETE FROM goods_item_combo_group_item_history WHERE group_id IN (SELECT id FROM goods_item_combo_group_history WHERE lease_code = 'schjyzzh' AND item_code = 'YL180606110506793' AND gmt_modified = '2018-06-07 23:18:51') 【Index writing DELETE goods_item_combo_group_item_history FROM goods_item_combo_group_item_history, goods_item_combo_group_history WHERE goods_item_...

MySQL SQL record

1.How to count the number of different values of the same column in the same query, so as to reduce the number of queries. For example, suppose you need to return the number of list menus at different levels through a query, you can query by the following statement: select SUM(IF(functionlevel=’0′,1,0)) as Level 1, SUM (IF (functionlevel=’1′, 1,0)) as second,SUM(IF(functionlevel=’2′,1,0)) as Level third, SUM (IF (functionlevel=’3′, 1,0)) as fourth, SUM (IF (functionlevel=’4′, 1,0)) as fifth., SUM(IF(functionlevel=’5′,1,0)...

Swift UITextfield add click method – simple implementation

1. Truly effective in any system. 1./// City choicePrivate lazy var cityTextfield:UITextField = {Let TF = UITextField ()Tf.deLegate = selfReturn TF} ()Two/ / / click the city@objc func clickCityTextfield () {Self.view.endEditing (true)View.showHud ()Self.requestForCity (ProtocolFollower: s)ELF)}3. extension JYShopAreaVc: UITextFieldDelegate{Func textFieldShouldBeginEditingTextField: UITextField) -> Bool {Self.clickCityTextfield ()Return false}} The following is the wrong way.1. No problem on iOS 11. It can be edited directly on iOS10 and iOS9. /// City choicePrivate lazy var cit...

Classification of design patterns

There are five kinds of creating patterns: factory method pattern, abstract factory pattern, singleton pattern, builder pattern and prototype pattern. There are seven structural modes: adapter mode, decorator mode, agent mode, appearance mode, bridge mode, combination mode and enjoyment mode. There are eleven behavioral patterns: policy pattern, template method pattern, observer pattern, iteration sub-pattern, responsibility chain pattern, command pattern, memo pattern, state pattern, visitor pattern, mediator pattern, interpreter pattern.

Django — the way to connect multiple databases

  *First of all, I’m using versions of Python 3.5 and Django 2.0.4, and the company is using Django, not restframework. I. application scenarios   First, a Django project usually has multiple apps, and now many companies share a common database of these apps. There are no so-called multiple databases in this scenario. In my personal experience, the company has made some small systems in the past two months.It’s all for sorting data inside the company), because each is in a hurry, so it’s done one online, and the database and the project are on different servers. Until o...

Webpack command Module build failed (from. / node_modules / babel-loader / lib / index. js) error problem solution

An error was reported when the project was running, and the error was Module build failed (from. / node_modules / babel-loader / lib / index. js)   Solution: Console input NPM install @babel/core @babel/preset-env command      Perfect solution

Use of Cobian backup 11

Host and backup machine create backup user (BF) On the backup machine Set up backup users. Backup directory right click Security, add the newly created backup BF user, and grant all rights. Set folder sharing and set up shared users as BF users just created. And in advanced sharing settings, remove everyone users, add BF users to grant all rights. Host install Cobian backup 11 software New task Schedule, choose how long to execute, execution time.  For the first time, it will be full backup, then backup the new files. If the log shows an incremental backup but a full backup is made, chec...

VNC boot failed

SSHLogin to server and restart VNC service with command line. $service vncserver start The following are the following: Starting VNC server: no displays configured                [FAILED] Solve: $vim /etc/sysconfig/vncservers View configuration files and modify the following two lines of configuration file parameters as follows: VNCSERVERS=”2:shim”VNCSERVERARGS[2]=”-geometry 1360×768  -nolisten tcp -localhost”$source /etc/sysconfig/vncservers Restart service, client connection server is normal.