"Ann.The above C code isQUOTE: int in = 0;
Char buffer [] = "Fred, John, Ann"
Char * p [3];
Char * buff = buffer;
While (p [in] = strtok (buf ,","))! = NULL ){
I ++;
Buf = NULL ;}
As shown in the above Code, the first execution of strtok needs to take the address of the target string as the first parameter (buf = buffer), and then strtok needs to take NULL as the first parameter (buf = NULL ). The pointer column p [] stores the split result. p [0] = "John", p [1] = "John ", p [2] = "Ann", and t
first batch number (BUF = buffer), and then strtok needs to take null as the first batch number (BUF = NULL ). The P [] pointer column stores the cut result. P [0] = "John", P [1] = "John ", P [2] = "Ann", and Buf becomes Fred/0 John/0ann/0.2. strtok VulnerabilitiesLet's change our plan: We have a string named "Fred male 25, John male 62, Anna female 16". We want to sort this string and input it to a struc
Tags: structure Data company nbsp Char remove DEP information valAn introductionTopics in this section Multi-Table Connection query Compound conditional Join Query Sub-query Prepare table Company.employeeCompany.department #建表 CREATE TABLE department (ID int, name varchar (20)); CREATE TABLE employee (ID int primary key auto_increment, name varchar (), sex enum (' Male ', ' female ') not null default ' MA
Le ', age int, dep_id int);
#插入数据 INSERT
Tags: sel cottage Learning-fuzzy query predicate student har IkeConnection queries: Design query join conditions or join predicates for two or more tables: The conditional general format used to connect two tables:[[Equivalent connections:The join operator is =Find out about each student and elective courseMysql> Select Student.*, sc.* from STUDENT,SC where student.sno=sc.sno;+-------+--------+------+------+-------+--- ----+-----+-------+| Sno | sname | Ssex | Sage | sdept | Sno | CNO | Grade |+
An introductionTopics in this sectionMulti-Table Connection queryCompound conditional Join QuerySub-queryPrepare tableCompany.employeeCompany.department#Build TableCREATE TABLE Department (ID int,name varchar (20) ; CREATE table employee (ID int primary KEY auto_increment,name varchar (20), sex enum ('male','female') notNull default'male', age int,dep_id int);#Inserting DataINSERT INTO department values (200,'Technology'),(201,'Human Resources'),(202,
/**MySQL Multi-Table Association*/One-to-one correlation such as city and area code correlation *******************First a city tableCID City Coid1 Beijing 12 Shanghai 23 Guangzhou 3One more Area code tableCoid Code1 0102 0203 0755This connects two tables together through the Association of CID and CoidSingle-to-one type his associated fields can be placed in two tables.Mysql> SELECT * from City,code where city.coid=code.coid;+-----+------+------+------+------+| CID | City | coid | coid | Code |
Tags: exists nbsp des AC style connection sel table implementation
First, Introduction
Second, multi-table connection query
Three, meet the conditions of connection query
Four, sub-query
First, IntroductionTopics in this section
Multi-Table Connection query
Compound conditional Join Query
Sub-query
Prepare table #Build Table
CREATE TABLE dep (ID int, name varchar (20)
); CREATE TABLE EMP (ID int primary key auto_increment, name varchar (20), sex
Tags: city information teacher REM Auto 5.0 values Shaanxi needs Create student table
IF not EXISTS ' student ' (
' id ' int (4) unsigned not NULL auto_increment,
' name ' varchar (a) Not null,
' sex ' enum (' Male ', ' female ') not null default ' male ',
' age ' tinyint (4) is not null default ' + ',
' edu ' enum (' early Middle ', ' High school ', ' College ', ' Big Ben ', ' graduate ') NOT NUL
Female: In?
Male: Well, I haven't seen you for a long time. What are Tsinghua College Students busy?
Female: nothing, that is, learning and work.
Male: Oh, it's rare to see you go online. Busy people, you are also monotonous in space. You don't even have a picture!
Female: I usually don't talk about QQ. I think it is a waste of youth, time, and energy. It is really boring. It takes a lot of time to
Data Query Language (Oracle VS MySQL)Simple QuerySuppose there is such a table students:STUDENT_ID MONITOR_ID NAME SEX DOB SPECIALTY------------------------------------------------------------10101 Wang xiaofang female-88 computer10205 Li qiufeng male 25-11 month-90 Automation10102 10101 Liu chunping female 12-8-91 computer10301 mountain male-90 Mechanical and Electrical Engineering10207 10205 Wang Gang
A man sold pigs in a rush, and 20 pigs were not sold in the dark, so he went to a farmer's house to stay. The young woman said: it is inconvenient to have only one person at home. Male: Please give me a pig. Female: Okay, but there is only one bed at home. Male: I am also sleeping in bed, and I have another pig. Female: Agree. In the middle of the night, I went to bed with you.
=buffer), after which the strtok needs to be NULL for the first (buf=null) parameter. Pointer column p[], the result of the cut is stored, p[0]= "John", p[1]= "John", p[2]= "Ann", and Buf becomes fred/0john/0ann/0.2. Strtok's weaknessesLet's change our plan: We have a string "Fred male 25,john male 62,anna female 16" We want to sort this string into a struct,Quote:struct Person {char [+] name;char [6] sex;C
1. Strtok Introduction
As is known to all, Strtok can be based on the user-supplied delimiter (which can also be plural for example). ”)Splits a section of string until it encounters a "yes".
For example, the delimiter = "," string = "Fred,john,ann"
by Strtok, 3 strings of "Fred" "John" "Ann" can be extracted.
The C code above is
Copy Code code as follows:
int in=0;
Char buffer[]= "Fred,john,ann"
Char *p[3];
char *buff = buffer;
while ((P[in]=strtok (buf, ","))!=null
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0Connected as [email protected] as SYSDBASql>Sql>--Create userSql>create user LPA identified by liPeng1;User createdSql>--Grant DBA authority to the userSql>Grant DBA to LPA;Grant succeededSql>--Create use table spaceSql>Create tablespace liPeng112datafile ' E:\oracle11\liPeng1.dbf '3size 1500M4autoextend on next 5M maxsize 3000M;Tablespace createdSql>--Grant users permission to use the tablespaceSql>ALTER user LPA quota unlimi
Tags: here insert data close Cartesian product Mil create table field sales keyMulti-Table Query
Multi-Table Connection query
Compound conditional Join Query
Sub-query
First, prepare the table#建表create Table Department (ID int,name varchar (20) ; CREATE table employee (ID int primary KEY auto_increment,name varchar (20), sex enum (' Male ',' Female ') notNULL default ' Male ', age int,
string in a static variable for the next call# Endif/* _ Mt */
/* Determine if a token has been found .*/If (string = Str)Return NULL;ElseReturn string;1. strtok IntroductionAs we all know, strtok can be based on user-provided delimiters (and separators can also be plural numbers, such as ",").Splits a string until "\ 0" is encountered ".For example, separator = "," string = "Fred, John, Ann"Using strtok, we can extract the three strings "Fred", "John", and "Ann.The above C code isQuote: int
In
"Black Hospital" Yulin Sunshine Hospital is the black hospital? SH "large-scale professional male hospital in north-west qq:287566666★★ Health Hotline: 400-8553-120★★ Yulin Sun Male Hospital" Yulin Sunshine Hospital experts said: only to a good normal male hospital to check and treatment, To heal the disease quickly. The following will give you a brief introducti
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.