In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The standard writing method of SQL sentence [199cloud-Aina]
1. Statement keywords should be all lowercase.
two。 Use single quotation marks when referencing characters. Such as: update testable set idcol='abcd'.
3. A space should be added before and after the connectors or operators or, in, and, =, +, -, etc. Otherwise, it is easy to lead to the following similar problems. For example, in the statement select a murb from table, ameme b is a variable. When spelling the statement, if a = 6 and b =-3, the statement becomes select 6 Murray 3 from table. -- A comment that is regarded as a SQL, resulting in an error in the statement.
4. Do not use "select * from …" Syntax, you must indicate the field name. Select col1, col2,... From tablea where...
5. The use of "insert into table_name values" is strictly prohibited. Syntax, uniformly use "insert into table_name (col1,col2,...) values (?,...)".
6. When the SQL statement contains a multi-table join, you must add the alias of the table, and use each field with the alias of the table. Select a.col1, a.col2, b.col3 from tablea a, tableb b where a.col4=b.col5
7. Explicit or implicit type conversions should be avoided. For example, a comparison of numeric and int columns in the where clause.
8. Parentheses must be added before and after the subquery. Select col1, col2 from tablea where col3 in (select col4 from tableb where col4 > 0)
9. Only one SQL should be executed at a time, and if more than one statement should be executed separately, but must remain in one transaction. It is not possible to execute multiple statements separated by semicolons and so on at a time, so the processing is not clear.
10. If or can be used instead, it is not appropriate to use in statements. The number of elements in an in statement must not exceed 500. if it does, it should be split into multiple SQL statements. It is forbidden to use xx in (',''... (.) Or xx in (',',').
11. The or connection condition must not exceed 500. if it is exceeded, it should be split into multiple statements.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.