1. Conditional Filtering & havingTable structure#tab_a#tab_bTable relationshipsTab_a.id = tab_b.relation_idTable DataDemandInquiry the Tab_a ID corresponding to the table Tab_b member_id, when not found in table Tab_b, assignment is
querying data for the current weekSELECT Name,submittime from the Enterprise WHERE Yearweek (Date_format (submittime, '%y-%m-%d ')) = Yearweek (now ());query last week's dataSELECT Name,submittime from the Enterprise WHERE Yearweek (Date_format
1. Naming rules for identifiers When you use identifiers in PL/SQL to define variables, constants, the identifier name must begin with a character and cannot exceed 30 characters in length. In addition, to improve the readability of the program,
DAYSQHQL = "Select sum (c.casenum) from domain. Case C where "+ " convert (varchar ( -1,120), c.limitlastdate,120) = "+ " convert (varchar (), GETDATE ()) "; number of items received yesterdayCONVERT (varchar)
Advanced query and difficulties of Oracle and Mysql SQLMysql query Yang Kai exclusive Channel OracleSQL 1. Connection query 1. Internal Connection is used to return all records that meet the connection conditions. By default, if no join operator is
Pessimistic lock Introduction (encyclopedia):
A pessimistic lock, as its name implies, is conservative in that the data is modified by the outside world (including other transactions of the system, as well as transactions from the external system),
Keywords: Oracle numeric function-type date conversion To_char automatic type conversion Date type numeric converter other function numeric functionABS: Find the absolute value function, such as: ABS (−5) 5SQRT: square root function, such as: sqrt (2
Recently studied the database pessimistic lock and optimistic lock, according to their own understanding and online resources summarized as follows:
Pessimistic Lock Introduction (encyclopedia):
A pessimistic lock, as its name implies, is
MySQL (for update) pessimistic lock summary and practice52701972Pessimistic locking, as its name implies, is a conservative attitude to the data being modified by the outside world (including other transactions currently in the system, as well as
Date function
Syntax: Date (ARG)
The date function returns a date in a date, timestamp, date string, or timestamp string. SQL
Code
Eg:
Select Date('2017-06-12 16.24.18.121212')FromTest
Eg: Select date ('2017-06-12 16.24.18.1212
8.2 write efficient queries
Efficient SQL code mainly refers to the efficient query using the SELECT command. The SELECT command allows the WHERE clause to reduce the amount of data read. The where clause is used to return (or not return) specific
It. oyksoft. for convenience, compost641 has created the following simple model and constructed some test data: in a business acceptance subsystem BSS, the SQL code-the customer data table createtablecustomers (mermer_idnumber (8) notnull, -- the
More than 30 mysql database optimization methods, with 10 million-level database records easily solved, mysql database
1. To optimize the query, try to avoid full table scanning. First, consider creating an index on the columns involved in where
How MySQL improves the speed of bulk importA recent project test, there are several MySQL database table data records reached hundreds of thousands of, in the building test environment to import test data, very slow.Search on the Internet, there are
1. To optimize the query, avoid full-table scanning as far as possible, and first consider establishing an index on the columns involved in the Where and order by.2. You should try to avoid null values in the WHERE clause, otherwise it will cause
1. To optimize the query, avoid full-table scanning as far as possible, and first consider establishing an index on the columns involved in the Where and order by.2. You should try to avoid null values in the WHERE clause, otherwise it will cause
1. Mysql limit usage when we use a query statement, we often need to return the first few or a few rows of data in the middle. What should we do at this time? Don't worry, mysql already provides us with such a function. SQL code SELECT *
Date FunctionSyntax: DATE (ARG)The DATE function returns the dates in a date, time stamp, date string, and timestamp string. SQL code eg: SELECT DATE(' 2005-06-12 16.24.18.121212 ') from TEST
Eg:
SELECT DATE (' 2005-06-12 16.24.18.121212 ') from
Turn from: http://lzkyo.iteye.com/blog/692680
indexes and corresponding tables should be located in different tablespaces (primary key (ID) using index tablespace mytable_index), and Oracle can read data on different hard disks in parallel to avoid
1. To optimize the query, avoid full-table scanning as far as possible, and first consider establishing an index on the columns involved in the Where and order by.2. You should try to avoid null values in the WHERE clause, otherwise it will cause
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.