be used to implement some special functions. But in performance, often an inappropriate subquery usage can create a performance bottleneck. If a subquery's condition uses a field of its outer table, this seed query is called a correlated subquery. Correlated subqueries can be introduced with in, not in, EXISTS, not EXISTS. A, not in, not EXISTS related subqueries can use a LEFT join instead of a notation Select Pub_name from publishers where pub_id not in (select pub_id from
aboveStatement created by the same user --------------------------------------------------------------------------- last step,
For specific users to set specific access rights, this can refer to the following simple example:-add only allow access to the specified table: execsp_addlogin ' username ', ' password ', ' default database name ' --Add to Database execsp_grantdbaccess ' username '--assign Full table permissions grantselect,insert update,deleteontable1to[User Name]--Assign permissio
subqueries. Note the following for related subqueries:
(1)
For subqueries related to a, not in, and not exists, you can use left join instead. For example, SELECT PUB_NAME from publishers where PUB_ID not in (SELECT PUB_ID from titles where type = 'business') can be rewritten to: select. PUB_NAME from publishers a left join titles B on B. TYPE = 'business' and. PUB_ID = B. PUB_ID where B. PUB_ID IS NULL
use IN, not in, EXISTS, and not exists to introduce related subqueries. Note the following for related subqueries:
(1) for subqueries not in and not exists, use left join instead. For example:
SELECT PUB_NAME from publishers where PUB_ID NOTIN (SELECT PUB_ID from titles where type = 'business ')
It can be rewritten:
Select a. PUB_NAME from publishers a leftjoin titles B on B. TYPE = 'business' and a. PUB_I
SQL server user access permission settings:
/* -- Example
Create a role r_test with all permissions of table jobs and SELECT permissions of table titles in database pubs, and then create a login Rochelle test, then, in the database pubs, the user account u_test is created for login l_test, and the user account u_test is added to the role r_test, so that it obtains the same permissions as the role r_test through permission inheritance, finally, the SEL
occurs during connection. Generally, you can specify the field sorting rule database_default when creating a temporary table in create table to avoid the above problems.
5. subquery usage
A subquery is a SELECT query nested in select, insert, update, delete statements, or other subqueries. Subqueries can be used wherever expressions are allowed.
Subqueries allow for flexible programming and can be used to implement some special functions. However, in terms of performance, an inappropriate
server will also regard it as SARG, and SQL SERVER will convert this formula:
Where price> 2500/2
However, we do not recommend this because sometimes SQL Server cannot guarantee that this conversion is completely equivalent to the original expression.
4. The role of in is equal to or.
Statement:
Select * From Table1 where TID in (2, 3)
And
Select * From Table1 where tid = 2 or tid = 3
If they are the same, they will cause a full table scan. If there is an index on the TID, its index will also b
displays the title and publisher of each book of the author.
Create proc au_info @ lastname varchar (40), @ firstname varchar (20)AsSelect au_lname, au_fname, title, pub_nameFrom authors inner join titleauthor on authors. au_id = titleauthor. au_idJoin titles on titleauthor. title_id = titles. title_idJoin publishers on titles. pub_id = publishers. pub_idWhere
Original http://blog.csdn.net/guoxuepeng123/article/details/7849681
1. subquery usageA subquery is a SELECT query nested in select, insert, update, and deleteStatement or other subqueries. Subqueries can be used wherever expressions are allowed. Subqueries allow for flexible programming and can be used to implement some special functions. However, in terms of performanceImproper subquery usage may cause a performance bottleneck.For subqueries related to a, not in, and not exists, you can use l
Analyze the response to find the required data
As a demonstration, we will use the author's blog http://dada.theblogbowl.in/. As the target URL.
The first two steps are relatively simple and can be completed as follows:
From urllib import urlopen # Sending the http requestwebpage = urlopen ('HTTP: // my_website.com/'). read ()
Next, send the response to the previously installed module:
From bs4 import BeautifulSoup # making the soup! Yummy;) soup = BeautifulSoup (webpage, "html5lib ")
Note th
project.View the. aspx page in the browser, and then verify this page works thus far.
The output should appear as Follows: 172-32-1176213-46-8915238-95-7766267-41-2394• ...
Back to the top Bind to the child Table 1. In the HTML view of the NestedRepeater.aspx page, locate the following line of code: Add the following code after This code: This new code adds a second Repeater the ItemTemplate property of the parent Repeater control.2. Set the DataSource property for the child Repeater contr
notation. For example: Select Pub_name from publishers where pub_id not in (select pub_id from TITLES WHERE TYPE = ' business ') can be rewritten as: Select A.pub_name from Publishers A, left JOIN, TITLES B on b.type = "Business" and a.pub_id=b. pub_id WHERE b.pub_id is NULL (2)
SELECT TITLE from TITLES
WHERE not EXISTS
(SELECT title_id from SA
The following example demonstrates DOM operations on XML. For more information, see the comments in the code.Copy codeThe Code is as follows:/*************************************** *********** Use XML in PHP5** Reference site:** Http://cn.php.net/manual/zh/ref.dom.php** The follow codes need PHP5 support**************************************** *********/// Create a DOMDocument object first$ Dom = new DomDocument ();// Load the XML file$ Dom-> load ("test. xml ");// Output the XML file// Header
Create roles, users, and permissions
/* -- Example descriptionIn the database pubs, create a role r_test with all permissions for table jobs and select permissions for table titles.Then a login l_test is created, and the user account u_test is created for login l_test in the database pubs.At the same time, add user account u_test to role r_test so that it can obtain the same permissions as role r_test through permission inheritance.Finally, the Select permission for table
to display several Fragment for page switching. You should have noticed the following three custom attributes in the TabLayout component:
App: tabIndicatorColor = @ color/white // scroll underline color app: tabSelectedTextColor = @ color/gray // The text color app after the tab is selected: tabTextColor = @ color/white // default text color of the tab
These three custom attributes are provided by TabLayout. We can modify the title Color and indicator color at will. In addition, we also provi
The following example demonstrates Dom operations on XML. For more information, see
Code Annotations in
Copy code The Code is as follows: /*************************************** *********
** Use XML in PhP5
** Reference site:
** Http://cn.php.net/manual/zh/ref.dom.php
** The follow codes need PhP5 support
**************************************** *********/
// Create a domdocument object first$ Dom = new domdocument ();// Load the XML file$ Dom-> load ("test. xml ");
// Output the XML fi
papers and read the Linux scheduling. Therefore, write scheduling-related items first.
First, we will introduce the human scenario corresponding to the process environment:
This is a company where many people (processes) have their corresponding titles (priorities ). This company is very strange, there is only one desk (CPU), at any time, only one person at work (task_running is running ). Others, either temporarily rest in the lounge (corresponding
Using Hadoop Mapreduce for data processing1. OverviewUse HDP (download: http://zh.hortonworks.com/products/releases/hdp-2-3/#install) to build the environment for distributed data processing.The project file is downloaded and the project folder is seen after extracting the file. The program will read four text files in the Cloudmr/internal_use/tmp/dataset/titles directory, each line of text in the file is a title from Wikipedia, read each title, and
The XML support is enhanced in PHP5, and the XML operation capability is extended using DOM. These functions are part of the PHP5 core and can be used without installation. The following example demonstrates DOM operations on XML. For more information, see the comments in the code.
The code is as follows:
/*************************************** *********** Use XML in PHP5** Reference site:** Http://cn.php.net/manual/zh/ref.dom.php** The follow codes need PHP5 support***********************
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.