; where ($ data)-> count (); // The array operation is more standard.
You can use SQL to directly query and perform more operations flexibly.
A. The primary number of queries processes the data read. The result set is returned successfully. if the query fails, the return value is boolean false.
$ M = M ();
$ Result = $ m->
Lesson 8th using functions to process data8.1 Functions"Noun" portable: The code you write can run on multiple systems8.2 Using Functions8.2.1 Text Processing functionsExample 1: Using the UPPER () function--Convert text to uppercaseSELECT UPPER as Vend_name_upcase from Vendors ORDER by Vend_name;Commonly used text-processing functions:
Left (): Returns the character to the ieft of the string
DATALENGTH (): Returns the length of a string
LOWER (): Converts a string to lowerca
One, the Oracle 11g database download, installation:Download:Then, based on this hyperlink build your own user, database.Http://wenku.baidu.com/view/caa21c1a650e52ea551898e2.htmlSecond, Navicat Premium connect Oracle1. Review the Tnsnames.ora file in the installation directory (F:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN).2, the connection, the first configuration option under the Oci file, download:Associated with the time,:OCI directory: D:\tools\instantclient-basic-nt-12.1.0.2.
in the water stains, oil, smoke in the harsh environment, the whole image of the temperament Berthelot off a clay turtle, the two is that this is not the work of the landlord want, Sometimes see our department and add some new 66-year-old younger brother I feel sorry for them, so in quit before the landlord has been on the internet to find a variety of career change work, at the beginning of the beginning, I also met a lot of career change people encountered problems: that is, what to do? In ad
SQL Server connection query details, SQL Server Query details
When querying multiple tables, we often use "join query ". Connection is the main feature of the relational database model and a symbol that distinguishes it from other types of database management systems.
What i
Summary of simple SELECT query statements in SQL, and SQL SELECT query statements
-- Scott users cannot use it. Use system to log on-- Modify scott account to unlockAlter user scott account unlock;-- Reset the password identified to be recognizedAlter user scott identified by tiger;
-- Select the scott user department
Label:The seventh chapter is also quite miscellaneous, see not very clear. Although I finished it, I felt that I had not got too many things and had to go back to see them.
See this CHR function,
The original is to turn the number into ASCII code, such as Chr (10) is the carriage return.BEGIN Dbms_output.Put_Line (' Gogo ' | |CHR (10) | | ' Tot '); end;/Use here | | To connect characters, or you can use Concat to connect. However, Concat has only two parameters, that is, connecting two s
duplicated in category
Select COUNT (distinct name) from Category: Find out the number of name not duplicated in category
11. New statement: (Insert into)
Insert into book (bookname,bookprice,bookauthors) VALUES (' C # basics ', ' + ', ' Ji ')
(insert bookname,bookprice,bookauthors The values of the three fields are: ' C # basics ', ' ' x ', ' Ji ') 12. UPDATE statement: (Update...set ... [where])
U
SQL like usage fuzzy query and SQL fuzzy query
Fuzzy query:
References: http://www.w3school.com.cn/ SQL/SQL _wildcards.asp
When searching for data in a database, you can use the
SQL query a specified date and time record SQL statement and query an instance
Create a table with the following abc structure:Create table 'cc'. 'loup '('Id' INT (4) not null AUTO_INCREMENT,'Datetimes 'INT (4) NULL,'Ipaddress' VARCHAR (20) NULL,Primary key ('id ')) ENGINE = MYISAMInsert data in batchesInsert into 'lou
SQL query specify date time record SQL statement and query instance
First create a table ABC structure is as followsCREATE TABLE ' cc '. ' Loup ' (' ID ' INT (4) Not NULL auto_increment,' DateTimes ' INT (4) NULL,' IPAddress ' VARCHAR NULL,PRIMARY KEY (' id ')) ENGINE = MYISAMThen BULK INSERT dataINSERT into ' loup '
SQL -- Process Multi-condition query and SQL page query on the page
Two methods are used to process multi-condition queries in the past. The first method is to determine the fields to be filled in the condition, and then determine whether the input parameter is null. If it is null, use 1 = 1 to replace this condition
1.in when the query condition is ListSelectId="getmultimomentscommentscounts"Resulttype="int">SelectMoment_comment_count fromTbl_moment_commentcountwhereMidinchforeachitem="Item"index="Index"collection="List"open="("Separator=","Close=")">#{item}foreach> Select>.1 if the type of the parameter is list, then when used, the collection property must be specified as a list
select id= "findbyidsmap" resultmap="Baseresultmap">
Select
include refi
The actual project, there are multiple tables of the association relationship. It is impossible to retrieve all the data in a single table. If there is no table connection, then we need a lot of action. For example, you need to find restrictive conditions from table A to retrieve data from table B. Not only need to be divided into multiple tables to operate, but also not high efficiency. For example in the book:
Copy Code code as follows:
Query and delete SQL statements of Repeated Records and query SQL statements of records
SQL statement for querying and deleting duplicate records1. Search for redundant duplicate records in the Table. duplicate records are determined based on a single field (peopleId ).Selec
the name that is not duplicated in category
Select COUNT (distinct name) from Category: Find out the number of name not duplicated in category
11. New statement: (Insert into)
Insert into book (bookname,bookprice,bookauthors) VALUES (' C # basics ', ' + ', ' Ji ')
(insert bookname,bookprice,bookauthors The values of the three fields are: ' C # basics ', ' ' x ', ' Ji ') 12. UPDATE statement: (Update...set ...
My Date
The first date format we get is this: 2009-2-12 or 2009-3-3 or 2009-10-12, we can do this by combining SQL statements: (three examples)
The code is as follows
Copy Code
@1select * from user where birthday> ' 2009-2-3 ' and birthday
This allows us to find all user information that includes 2009-2-3 and is greater than 2009-2-3.
@2 If that's how we mix it.
The code is as follows
Copy Code
SQL Server quickly generates SQL addition, deletion, modification, and query statements, and SQL addition and DeletionAre you still coding to generate SQL statements? Are you still speechless for SQL statements that are sloppy? Ar
results of multiple SELECT statements together, in which case it is necessary to combine the results of several SELECT statements, for example, to query all the employee information of company A and Company B, and then merge the results of the two queries together. The Union and UNION ALL keywords are used for the merge operation. Format: SELECT statement 1 UNION | UNION All SELECT statement 2 UNION | UNION All ............ Example:
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.