The first is SQL server usage:
The structure of a table is as follows: ID name contetid1 Test 12 test1 13 Test2 14 test3 25 test4 2Add its records to another table with the following structure:
Contetid names1 test, test1, Test22 test3, test4
The original Article link has been forgotten. Sorry.
You can use the SQL keyword "begin" and "unregister" to easily and quickly convert data rows and columns. If you don't talk much about it, go directly to the code. Please use msdn for their syntax.
Table structure
ID KEY VAL
1 Sex Male
2 Day 365
4 Num 12345
Now I want the echo $a [' sex '] on this page to display the male echo $a [' Day '] to show 365
PHP query MySQL statement how to write convenient at any time echo it?
Reply to
Reading directory
I. Preface
Ii. First Thought
Iii. Second Thought
4. The third thought
I. Preface
In some of our projects, we often encounter the problem of converting rows into columns. Now let's discuss how we can convert Table 1 to
OverviewRecently approached a new concept-the row value expression, also called the row value constructor. This is a very powerful SQL feature, and usually the SQL expression that we manipulate can only be compared against a single field in a row,
Summary of row-to-column issues1, Row to column---1, the simplest row to column/*Question: Suppose there is a student score table (TB) as follows:Name Course ScoreZhang San language 74Zhang San Mathematics 83Zhang San Physics 93John Doe Language
Let's say a student score table (TB) is as follows:Name Course ScoreZhang San language 74Zhang San Mathematics 83Zhang San Physics 93John Doe Language 74John Doe Mathematics 84John Doe Physics 94Want to become (get the following result):Name Chinese
This is the script file that created the databaseCREATE TABLE [dbo]. [Stu] ([study number] [nvarchar] (255) not null,[name] [nvarchar] (255) null,[sex] [nvarchar] (255) null,[Professional] [nvarchar] (255) null,[faculties] [ NVARCHAR] (255) NULL) on
Unlimited classification is often used in column classification. Today we will look at an example of PHP unlimited classification using left and right values. I hope this example will help you. Unlimited classification is often used in column
Row to column, column change is the problem we often encounter in the development process. Row-columns are typically implemented by the case-when statement, or by SQL SERVER 2005 's new operator pivot. In the traditional way, better understanding.
"One" Row to column1. Query the original data/*** the theme of this exercise, row to column, the column change ***/SELECT * FROM Scores2, get name, through GROUP bySelect Student as ' name 'From ScoresGROUP BY StudentORDER BY Student3, plus Max,
1. Basic Tables2. Row to column, note the use of ISNULL function, in the overall statistics, ISNULL (-,0) is necessary to use3. The list of career changes, the list of languages, mathematics, English, politics, the conversion to 2 columns, score
One, DB SQL statements
DB Used for PHP infinite classificationCREATE TABLE Tree (ID Int (TEN) NOT null primary key auto_increment,Name varchar (255) NOT NULL,LFT Int (a) not null default 0,RGT Int (a) not null default 0,status int (1) NOT null
PHP unlimited classification-left and right values are included (move multiple nodes; move a single node; delete multiple nodes; delete a single node; add a node), with a database table structure attached ~ If you have any questions, leave a message
Include (move multiple nodes, move a single node, delete multiple nodes, delete a single node, add a node), attach a database table structure ~ There is a problem can leave a message (www.webyang.net).
DB SQL statement//db used for PHP infinite
Because the unit designs the database tables, all use SQL. I don't know what the reason is not to powerdesign or Ermaster tools, to build a table is painful as a program ape of course to find a solution, write a program with Python to solveNeed to
Sometimes we will call the list page or the Content Detail page designated top-level column name and link, try a lot of methods, some can only call all top-level columns or sub-columns below the channel, it is very confusing. Let's talk about the
Here's how to call the various column names:
1, {Dede:field name= "typename"} This is the name of the call current column2. {dede:channel type= ' son ' row= ' 5 '} [field:typename/] {/dede:channel} This is the call to the top channel all Word
SQL Server row to column
--Create a row to list and insert dataCreate TableTb_rowconverttocolumn (usernamenvarchar( -)NULL, Coursenvarchar( -)NULL, score numeric (Ten,2)NULL)Insert intoTb_rowconverttocolumn (Username,course,score)Values('Zhang
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.