In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what does it mean to write" after the where condition in the SQL sentence? in the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
This code should be generated by the program (for example, Java), and the conditions after 1 to 1 in the where condition are dynamically changed through the if block. For example: String sql= "select * from table_name where 1 # 1"; if (conditon 1) {sql=sql+ "and var2=value2";} if (conditon 2) {sql=sql+ "and var3=value3";} where 1 # 1 is to avoid syntax errors caused by the first word after the where keyword directly being "and". The purpose of connecting AND condition where 1 to 1 in dynamic SQL is to avoid syntax errors caused by the first word after the where keyword that is directly "and". There must always be a statement after where, and you can ensure that the syntax will not go wrong after adding 1x1! because there is no field named 1 in table, the SQL is equivalent to where * from table. This SQL statement obviously requires a large number of IO operations. The larger the amount of data, the slower the data. It is recommended to add the required input items when querying, that is, adding some commonly used required conditions after where 1. And if these necessary conditions are properly indexed, the efficiency of copying table create table table_nameas select * from Source_tablewhere 1 will be greatly improved.
Copy table structure
Create table table_nameas select * from Source_table where 11; "what is written after the where condition in the SQL statement?" this is the end of the introduction. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.