-
In what program is it used?
1.Use name1, name2, name3
name4 name5 name6
Give li style in CSS: line-hight:10px;
2.Use. 3.Use.
-
select name1 , name2 , name3 from biao
union all
select name4, name5,name6 from biao
How many fields are there, and so on.
-
Use union to assemble the data query results of each 3 columns
-
select Province, Number, Name, Phone1 from table.
union all
select Province, Number, Name, Mobile2 as Mobile1 from table.
union all
select Province, Number, Name, Phone3 as Phone1 from table.
Note: The above query is not sorted.
-
select a.* from
select province, number, name, phone number1 from table name union all
select Province, Number, Name, Phone2 as Phone1 from Table Name.
union all
select Province, Number, Name, Phone3 as Phone1 from Table Name) as a
order by a.Province, ANo., aName.
-
Replace it directly, use the string function.
-
Positive rolling. select name,sum(case when type=1 then 1 else 0 end) as type:year:a,sum(case when type=2 then 1 else 0 end) as type:b,sum(case when type=3 then 1 else 0 end) as type:c,count(*)as total.
from table.
group by name.
-
Suppose your table is Fushan test12(name,type), then the SQL statement for the following is as follows;
select name as "The name is a letter",max(case when type=1 then 1 else 0 end) as "Type A",max(case when type=2 then 1 else 0 end) as "Class Lack Zen Medium B",max(case when type=3 then 1 else 0 end) as "Type C",count(*)as "Total" from test12 t group by name;
-
select sum(case when brand=.'Ruyi card'then 1 else 0 end ) Ruyi card ,sum(case when brand='Long-distance passes'then 1 else 0 end ) long distance ,sum(case when brand='New forces'then 1 else 0 end ) new forces , the name of the outlet and the name of the owner.
from table
group by Location Name Store owner's name.
-
Select outlet name, store owner name, sum(case brand when'Ruyi card'then 1 else 0 end) Ruyi card, sum(case brand when'New forces'then 1 else 0 end) New Forces, - not all written, note that the last line does not add a comma.
from table name group by outlet name, store owner name.
If you want to save this dataset to the table, then I believe I don't need to say more, I really won't just f1, inserting the dataset into the table is an insert.
-
Agree with the upstairs.
select
The name of the outlet, the name of the owner, sum(case brand when'Ruyi card' then 1 else 0 end) as 'Ruyi card', sum(case brand when'Long-distance passes' then 1 else 0 end) as 'Long-distance passes', sum(case brand when'New forces' then 1 else 0 end) as 'New forces'
from the table name.
group by Location Name Store owner's name.
-
select name, (case when subject=mathematics then score end) as mathematics, (case when subject=language then score end) as language, (case when subject=english then score end) as english from table name.
-
select name, decode(subject, language, fraction) as language, decode(subject, mathematics, fraction) as mathematics, decode(subject, english, fraction) as english.
from indicates group by name.
-
I also learned about databases this semester, and I didn't understand it, but I just came to complain, hehe, I'm sorry.
-
Select Name, AFraction [mathematics], bFraction [language], cFractions, from table
left outer join
select name, score from table where subject='Mathematics')a on table.Name=aName.
left outer join
select name, score from table where subject='Language')b on table.Name=b.Name.
left outer join
select name, score from table where subject='English')c on table.Name = cName.
order by name.
-
select name, math=sum(case when subject='Mathematics'then score), language=sum(case when subject='Language'then score), English = sum(case when subject='English'then score) group by name.
Try it, so let's do it.
-
You can convert the character type first and then add it.
select id,cast(col1 as varchar) +'~'+ cast(col2 as varchar) as col from your table.
-
- It's very simple.,The following passed the SQL2005 test.,Landlord please see:
create table #t(a int,b int,c int,d int)
insert #t
select 1, 2, 3, 4 union allselect 5, 6, 7, 8
select a,b,c,0 as d from #tunion
select a,b,0 as c,d from #t
-
You also give each data rule that becomes multiple rows of data, and I don't know how to help you, hehe.
-
I can see some patterns, but I still don't understand how you want to change.
Positive: Hobbies are the best teachers of human beings, and we should strive for them. >>>More
Arguments against the side:Our position is, "Love one line, do one line". >>>More
When using the input method, click the "Left Hook" icon in the lower right corner to complete the carriage return line wrapping operation.
It can be calculated according to your year of birth.
1. First of all, open the original document and click "Options" in the upper left corner. >>>More