mysql不支持update set from where这种写法,改用update inner join on set

update set from where时报错

update a.pay_info set a.need_pay=b.pay from brick.pay_info a ,(select debt+pay_way as pay , pay_id from brick.pay_map) b where a.pay_id = b.pay_id ;
报错信息 15:55:21 Error Code: 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 near ‘from brick.pay_info a ,(select debt+pay_way as pay , pay_id from brick.pay_map’ at line 1 0.000 sec from处显示显示from is not valid at this

改用update inner join on set

update (select debt+pay_way as pay , pay_id from brick.pay_map) b inner join brick.pay_info a on a.pay_id = b.pay_id set a.need_pay=b.pay ;

update set from where时 “from“ is not valid at this position ,expecting EOF,“;“ (表中两字段运算结果赋值给另一个表的字段) ***from处显示显示from is not valid at this***
About This Book Develop a strong set of programm ing skills with Pyhton that you will be able to express in any situation, on every platform, thanks to Python's portability Stop writ ing scripts and start architect ing programs by apply ing object-oriented programm ing techniques in Python Learn the trickier aspects of Python and put it in a structured context for deeper understand ing of the language Who This Book Is For This course is meant for programmers who wants to learn Python programm ing from a basic to an expert level. The course is mostly self-contained and introduces Python programm ing to a new reader and can help him become an expert in this trade. What You Will Learn Get Python up and runn ing on Windows, Mac, and Linux in no time Grasp the fundamental concepts of cod ing , along with the basics of data structures and control flow Understand when to use the functional or the object-oriented programm ing approach Extend class functionality us ing inheritance Exploit object-oriented programm ing in key Python technologies, such as Kivy and Django Understand how and when to use the functional programm ing paradigm Use the multiprocess ing library, not just locally but also across multiple machines In Detail Python is a dynamic and powerful programm ing language, hav ing its application in a wide range of domains. It has an easy-to-use, simple syntax, and a powerful library, which includes hundreds of modules to provide routines for a wide range of applications, thus mak ing it a popular language among program ing enthusiasts.This course will take you on a journey from basic programm ing practices to high-end tools and techniques giv ing you an edge over your peers. It follows an interest ing learn ing path, divided into three modules. As you complete each one, you'll have gained key skills and get ready for the material in the next module.The first module will begin with explor ing all the essentials of Python programm ing in an easy-to-understand way. This will lay a good foundation for those who are interested in digg ing deeper. It has a practical and example-oriented approach through which both the introductory and the advanced topics are explained. Start ing with the fundamentals of programm ing and Python, it ends by explor ing topics, like GUIs, web apps, and data science.In the second module you will learn about object oriented programm ing techniques in Python. Start ing with a detailed analysis of object-oriented technique and design, you will use the Python programm ing language to clearly grasp key concepts from the object-oriented paradigm. This module fully explains classes, data encapsulation, inheritance, polymorphism, abstraction, and exceptions with an emphasis on when you can use each principle to develop well-designed software.With a good foundation of Python you will move onto the third module which is a comprehensive tutorial cover ing advanced features of the Python language. Start by creat ing a project-specific environment us ing venv. This will introduce you to various Pythonic syntax and common pitfalls before mov ing onto functional features and advanced concepts, thereby gain ing an expert level knowledge in programm ing and teach ing how to script highest quality Python programs. Style and approach This course follows a theory-cum-practical approach hav ing all the ing redients that will help you jump into the field of Python programm ing as a novice and grow-up as an expert. The aim is to create a smooth learn ing path that will teach you how to get started with Python and carry out expert-level programm ing techniques at the end of course. Table of Contents Module 1: Learn ing Python Chapter 1: Introduction and First Steps – Take a Deep Breath Chapter 2: Built-in Data Types Chapter 3: Iterat ing and Mak ing Decisions Chapter 4: Functions, the Build ing Blocks of Code Chapter 5: Sav ing Time and Memory Chapter 6: Advanced Concepts – OOP, Decorators, and Iterators Chapter 7: Test ing , Profil ing , and Deal ing with Exceptions Chapter 8: The Edges – GUIs and Scripts Chapter 9: Data Science Chapter 10: Web Development Done Right Chapter 11: Debugg ing and Troubleshoot ing Chapter 12: Summ ing Up – A Complete Example Module 2: Python 3 Object-Oriented Programm ing Chapter 1: Object-oriented Design Chapter 2: Objects in Python Chapter 3: When Objects Are Alike Chapter 4: Expect ing the Un expected Chapter 5: When to Use Object-oriented Programm ing Chapter 6: Python Data Structures Chapter 7: Python Object-oriented Shortcuts Chapter 8: Str ing s and Serialization Chapter 9: The Iterator Pattern Chapter 10: Python Design Patterns I Chapter 11: Python Design Patterns II Chapter 12: Test ing Object-oriented Programs Chapter 13: Concurrency Module 3: Master ing Python Chapter 1: Gett ing Started – One Environment per Project Chapter 2: Pythonic Syntax, Common Pitfalls, and Style Guide Chapter 3: Containers and Collections – Stor ing Data the Right Way Chapter 4: Functional Programm ing – Readability Versus Brevity Chapter 5: Decorators – Enabl ing Code Reuse by Decorat ing Chapter 6: Generators and Coroutines – Infinity, One Step at a Time Chapter 7: Async IO – Multithread ing without Threads Chapter 8: Metaclasses – Mak ing Classes (Not Instances) Smarter Chapter 9: Documentation – How to Use Sphinx and reStructuredText Chapter 10: Test ing and Logg ing – Prepar ing for Bugs Chapter 11: Debugg ing – Solv ing the Bugs Chapter 12: Performance – Track ing and Reduc ing Your Memory and CPU Usage Chapter 13: Multiprocess ing – When a S ing le CPU Core Is Not Enough Chapter 14: Extensions in C/C++, System Calls, and C/C++ Libraries Chapter 15: Packag ing – Creat ing Your Own Libraries or Applications Title: Python: Journey from Novice to Expert Author: Dusty Phillips, Fabrizio Romano, Rick van Hattem Length: 1311 pages Edition: 1 Language: English Publisher: Packt Publish ing Publication Date: 2016-08-31 ISBN-10: B01LD8K8WW
update movie set desc="2021-05-21 08:00~10:00" where key=1就是这么简单的一句更新语句愣是报错了半小 ,最后才找到原因短短一句话我用了 个保留字'desc'、'key',解决办法就是加上反引号``,改成 update movie set `desc`="2021-05-21 08:00~10:00" where `key`=1
select * from cop.student where sdept='CS' intersect select * from cop.student where sage<=19 /*查询计算机科学系的学生与年龄不大于19岁的学生的交集*/ select sno from cop.sc where cno='1' INTERSECT select sno from cop.sc where cno='2'; /*查询选修课程1的学生集合与选修课程2的学生集合的交集*/ 打完代码就发现代码