, Atitle, PIDNumber name superior number for province and municipality PID is nullIn this way we want to correlate the query to the subordinate data, need to use the self-correlation. To Create a table:CREATE table area (Aid int PRIMARY KEY,--own numberatitle varchar (20),--Own namePID INT--The number of the superior );Self-correlating statements:Select City.* from area as CityINNER join area as provinceOn city.pid = province.id;where province.atitle = "Shanxi province"--Query all cities
The most commonly used SELECT statement in SQL, which is used to select data in a table.The knowledge points to remember are as follows:
SELECT Statement Format:
SELECT the column name to query from the table n
Environment: MySQL5.5 InnoDB Table
post, the primary key is
id
The requirements are very simple, returned by ID post.name , need to return the specified number at one time, so used where id in :
select `name` from `post` where `id` in(2142324,2106574,2106564,2075699,2065402,2050790,2038346,2038345,2035588,2031765,2022035,2022034,2020745,2020737,2020718,1987558,1970241,1962232,1911342,1891481,1889641,1877438,1877434,1867217,1866057,1866013,1847315);
E
The basic query operations in LINQ are the same as those in SQL, and for similarities and differences, let's look at the following:1) SelectGrammar:Description:
The Select method itself is a generic collection extension method
It acts on the ienumerable
It only accepts one func
Func
2) WhereGrammar:Description:
The Where method is also a generic extension method
It acts on the ienumerable
It accepts only one
JS changes the option attribute in the select statement. js changes the selectoption.
This example describes how to change the option attribute in select by JS. Share it with you for your reference. The details are as follows:
A friend solved a small problem. The requirement was to change the text value displayed in the selected tab and store the new value in a t
[email protected] ~]$ cat test1.sh#!/bin/bashecho "What is your operating system?"Select Os in "Linux" "Unix" "Mac" "Windows"DoBreakDoneecho "Your operating system is $os"[[email protected] ~]$./test1.sh #? Subsequent numbers require manual input by the userWhat is your operating system?1) Linux2) Unix3) Mac4) Windows#? 1Your operating system is Linux[Email protected] ~]$./test1.shWhat is your operating system?1) Linux2) Unix3) Mac4) Windows#? 2Your o
The usage of SELECT statement is described in detail. Data tables have been created. if we have inserted a lot of data, we can search and display the information in the data table in our favorite way, for example, if a data table has been created and we have inserted a lot of data, we can search and display the information in the data table in our favorite way. for example: the content in the entire data ta
The following articles mainly introduce the actual operation steps for the Oracle SELECT statement auto-join in the SQL tutorial. Until now, we have connected two different related tables, have you ever wondered whether you can establish a self-connection to one of the tables? The answer is yes.
Is it necessary to connect a table? The answer is yes.
Table alias:
A table can be connected by itself. We need a
Databases are people who exist to manage information more easily and efficiently, and want the database to provide the information they need at any time. Therefore, for the user, the data query is the data
The most important function of the library. This chapter describes how to implement a data query.
In a database, a data query is done through a SELECT statement. The
Normal query (SELECT statement used to select data from the database)
The SELECT from syntax is used to query read data from a datasheet.
Grammar:
The code is as follows
Copy Code
SELECT Column1,column1,... From Tb_name
If you want to
Tags: str SQ varchar Other replace sel har result i+1Quick Build Insert Update SELECT statementDeclareStext VARCHAR2 (3000);STable VARCHAR2 (30);BeginSTable: = ' tablename ';Select Get_sql_insert (sTable) to stext from dual;Dbms_output.put_line (stext);Dbms_output.put_line (");Dbms_output.put_line (");Select Get_sql_update (sTable) to stext from dual;Dbms_output.
MySQL query statistics for a single SELECT statement is often complex in writing statements. The following describes how to use only one SELECT statement to help you.
Where can I use a single SELECT statement to implement MySQ
The "lock options" function in SELECT statements shows that SQLServer provides a powerful and complete locking mechanism to help achieve database system concurrency and high performance. You can use the default settings of SQLServer or use the "lock option" in the select statement to achieve the expected results. This article introduces the "lock options" in the
If testexpression matches any of the case expressionlist expressions
, execute the statement between this case clause and the next one, for the last
clause, the statement is executed between the clause and the end Select, and the control
The statement that is transferred after the end
MySQL management data can certainly be very convenient to export data, but when the amount of data is very large, phpmyadmin is likely to occur execution timeout, in fact, it is easy to use SELECT INTO OutFile solution!
SELECT ... The main function of the into OUTFILE statement is that you can quickly dump a table onto the server machine. If you want to create a
The SQL SELECT into statement can be used to create a backup copy of the table.SELECT into statementThe SELECT INTO statement selects data from one table and then inserts the data into another table.The SELECT into statement is co
Created_time
Between
@ Dtstarttime
And
@ Dtendtime
Select
A. Aid, A. created_time
From
Tablea
With
(Nolock)
Join
# Temptable B
On
A. Aid
=
B. Bid
Truncate
Table
# Temptable
Drop
Table
# Temptable
The result is displayed in 2 seconds on the product server.
Scenario 3: I did another test. If a. created_time does not exist in the SELECT
that the target table Table2 not exist because the table Table2 is automatically created when inserting and the specified field data in Table1 is copied to Table2.
The code is as follows
Copy Code
Select * into TEST_TABLE_TP1 from Test_table_draw where ' borough_id ' >=10266 and ' borough_id '
GG Check that the original MySQL database does not support SELECT into f
By dom
// Use dom
$ ("Floatingfrequencycode"). Options. insertbefore (createoption (thestr, "01 "),
$ ("Floatingfrequencycode"). Options [0]);
// This method is required to generate optino
Function createoption (thetext, thevalue)
...{
VaR theoption = Document. createelement ("option ");
Theoption. innerhtml = thetext;
Theoption. value = thevalue;
Return theoption;
}
Function createoption (thetext, thevalue) not in Dom Mode)...{VaR theoption = Document. createelement ("option ");Theoption. Tex
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.