Sub 项目状态查询()

'如果“项目状态”是未转运营那么实施状态是不能选择的,因为还没有实施。
'如果“项目状态”选择状态后,那么项目名称里面只显示该状态的项目名称。如果“项目状态”选择的不是未转运营,那么“实施状态”也要选择,并确定项目名称的选项。
'如果“统计值”是项目数,那么标题行就是客户角色。如果是实施时长,标题行就是实施的时间。
lst = Range("a1048576").End(xlUp).Row
If lst >= 4 Then
Range("a4:afd" & lst).ClearContents
End If

sAddress = ThisWorkbook.FullName

If Range("b1") = "未转运营" Or Range("b1") = "全部" Then
sAddress1 = Sheets("销售").Range("a3").CurrentRegion.Address(0, 0)

If Range("b1") = "全部" Then
temp1 = "辅助列"
Else
temp1 = "项目状态"
End If

If Range("d1") = "全部" Then
temp2 = "辅助列"
Else
temp2 = "城市维度"
End If

If Range("d2") = "全部" Then
temp3 = "辅助列"
Else
temp3 = "加盟类型"
End If

If Range("h2") = "全部" Then
temp4 = "辅助列"
Else
temp4 = "项目名称"
End If

Set cnn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cnn.Open "Provider=microsoft.Ace.oledb.12.0;Extended Properties=Excel 12.0;Data Source=" & sAddress

strsql = "select * from [销售$" & sAddress1 & "] where " & temp1 & " = '" & Range("b1") & "' and " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "'"

strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , count(*) as 统计 from (select * from [销售$" & sAddress1 & "] where " & temp1 & " = '" & Range("b1") & "' and " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "') group by " & Range("b3").Value & " , " & Range("b2").Value & ""

strsql = "transform count(*) select " & Range("b2").Value & " as 统计 from (select * from [销售$" & sAddress1 & "] where " & temp1 & " = '" & Range("b1") & "' and " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "') group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""

strsql = "transform count(*) select " & Range("b3").Value & " as 统计 from (select * from [销售$" & sAddress1 & "] where " & temp1 & " = '" & Range("b1") & "' and " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "') group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""

strsql = "transform count(*) select " & Range("b3").Value & " as 统计 from (select * from [销售$" & sAddress1 & "] where " & temp1 & " = '" & Range("b1") & "' and " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "') group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""

strsql = "transform count(*) select " & Range("b2").Value & " as 统计 from (select * from [销售$" & sAddress1 & "] where " & temp1 & " = '" & Range("b1") & "' and " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "') group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

'sum(iif(isnull(项目名称),0,1))

rs.Open (strsql), cnn
Cells(5, 1).CopyFromRecordset cnn.Execute(strsql)

For Each Field In rs.Fields
aa = Field.Name
[a4].Offset(0, i) = Field.Name
i = i + 1
Next

Set rs = Nothing
Set cnn = Nothing
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ElseIf Range("b1") = "销售转运营" And Range("h1") = "项目数" Then
sAddress1 = Sheets("实施").Range("a3").CurrentRegion.Address(0, 0)

If Range("d1") = "全部" Then
temp2 = "辅助列"
Else
temp2 = "城市维度"
End If

If Range("d2") = "全部" Then
temp3 = "辅助列"
Else
temp3 = "加盟类型"
End If

If Range("h2") = "全部" Then
temp4 = "辅助列"
Else
temp4 = "项目名称"
End If

If Range("f1") = "全部" Then
temp5 = "辅助列"
Else
temp5 = "实施进度"
End If

If Range("f2") = "全部" Then
temp6 = "辅助列"
Else
temp6 = "实施类型"
End If

Set cnn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cnn.Open "Provider=microsoft.Ace.oledb.12.0;Extended Properties=Excel 12.0;Data Source=" & sAddress

strsql = "select * from [实施$" & sAddress1 & "] where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "' and " & temp5 & " = '" & Range("f1") & "' and " & temp6 & " = " & "'" & Range("f2") & "'"

strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , count(*) as 统计 from (select * from [实施$" & sAddress1 & "] where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "' and " & temp5 & " = '" & Range("f1") & "' and " & temp6 & " = " & "'" & Range("f2") & "') group by " & Range("b3").Value & " , " & Range("b2").Value & ""

strsql = "transform count(*) select " & Range("b2").Value & " as 统计 from (select * from [实施$" & sAddress1 & "] where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "' and " & temp5 & " = '" & Range("f1") & "' and " & temp6 & " = " & "'" & Range("f2") & "') group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""

strsql = "transform count(*) select " & Range("b3").Value & " as 统计 from (select * from [实施$" & sAddress1 & "] where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "' and " & temp5 & " = '" & Range("f1") & "' and " & temp6 & " = " & "'" & Range("f2") & "') group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""

strsql = "transform count(*) select " & Range("b3").Value & " as 统计 from (select * from [实施$" & sAddress1 & "] where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "' and " & temp5 & " = '" & Range("f1") & "' and " & temp6 & " = " & "'" & Range("f2") & "') group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""

strsql = "transform count(*) select " & Range("b2").Value & " as 统计 from (select * from [实施$" & sAddress1 & "] where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' and " & temp4 & " = " & "'" & Range("h2") & "' and " & temp5 & " = '" & Range("f1") & "' and " & temp6 & " = " & "'" & Range("f2") & "') group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

'sum(iif(isnull(项目名称),0,1))

rs.Open (strsql), cnn
Cells(5, 1).CopyFromRecordset cnn.Execute(strsql)

For Each Field In rs.Fields
aa = Field.Name
[a4].Offset(0, i) = Field.Name
i = i + 1
Next

Set rs = Nothing
Set cnn = Nothing

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ElseIf Range("b1") = "销售转运营" And Range("h1") <> "项目数" Then
sAddress1 = Sheets("实施").Range("a3").CurrentRegion.Address(0, 0)
If Range("d1") = "全部" Then
temp2 = "辅助列"
Else
temp2 = "城市维度"
End If

If Range("d2") = "全部" Then
temp3 = "辅助列"
Else
temp3 = "加盟类型"
End If

If Range("f1") = "全部" Then
temp4 = "辅助列"
Else
temp4 = "实施进度"
End If

If Range("f2") = "全部" Then
temp5 = "辅助列"
Else
temp5 = "实施类型"
End If

If Range("h2") = "全部" Then
temp6 = "辅助列"
Else
temp6 = "项目名称"
End If

Set cnn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cnn.Open "Provider=microsoft.Ace.oledb.12.0;Extended Properties=Excel 12.0;Data Source=" & sAddress

str1 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',项目开始时间,项目结束时间) as 天数,运营经理人数 as 人数,运营经理成本 as 成本,'运营经理' as 岗位,'城市运营组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str2 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',仓调研开始日期,仓调研结束日期) as 天数,仓调研人数 as 人数,仓调研成本 as 成本,'仓调研' as 岗位,'仓运营组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str3 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',配调研开始日期,配调研结束日期) as 天数,配调研人数 as 人数,配调研成本 as 成本,'配调研' as 岗位,'配运营组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str4 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',仓库规划实施开始日期,仓库规划实施结束日期) as 天数,仓规划人数 as 人数,规划成本 as 成本,'仓规划' as 岗位,'仓库规划组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str5 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',实施筹备开始日期,系统上线日期) as 天数,实施人数 as 人数,实施人员成本 as 成本,'实施' as 岗位, '实施组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str6 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',B2B进件资料审核开始时间,商品B2B平台发布上架日期) as 天数,电商人数 as 人数,null as 成本,'电商客服' as 岗位,'客服组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str7 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',首次入仓日期,首次发货日期) as 天数,库房人数 as 人数,null as 成本,'库房' as 岗位,'仓库运营组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

str8 = "select 销售转运营日期,周期维度,项目名称,城市维度,加盟类型,客户角色,仓库名,实施进度,项目阶段,阶段状态,实施类型,辅助列,月份维度," & _
" datediff('d',驻场日期,离场日期) as 天数,驻场人数 as 人数,null as 成本,'驻场' as 岗位,'城市运营组' as 组名 from [实施$" & sAddress1 & "] " & _
" where " & temp2 & " = '" & Range("d1") & "' and " & temp3 & " = '" & Range("d2") & "' " & _
" and " & temp4 & " = " & "'" & Range("f1") & "' and " & temp5 & " = " & "'" & Range("f2") & "' " & _
" and " & temp6 & " = " & "'" & Range("h2") & "'"

strtotal = str1 & " union all " & str2 & " union all " & str3 & " union all " & str4 & " union all " & str5 & " union all " & str6 & " union all " & str7 & " union all " & str8

If Range("h1") = "实施人天(avg)" Then

strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , avg(人数*天数) as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & ""

strsql = "transform avg(人数*天数) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""

strsql = "transform avg(人数*天数) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""

strsql = "transform avg(人数*天数) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""

strsql = "transform avg(人数*天数) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

ElseIf Range("h1") = "实施人天(sum)" Then

strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , sum(人数*天数) as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & ""

strsql = "transform sum(人数*天数) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""

strsql = "transform sum(人数*天数) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""

strsql = "transform sum(人数*天数) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""

strsql = "transform sum(人数*天数) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

ElseIf Range("h1") = "成本(avg)" Then

strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , avg(成本) as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & ""

strsql = "transform avg(成本) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""

strsql = "transform avg(成本) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""

strsql = "transform avg(成本) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""

strsql = "transform avg(成本) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

ElseIf Range("h1") = "成本(sum)" Then

strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , sum(成本) as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & ""

strsql = "transform sum(成本) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""

strsql = "transform sum(成本) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""

strsql = "transform sum(成本) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""

strsql = "transform sum(成本) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

'ElseIf Range("h1") = "项目数" Then
'
'strsql = "select " & Range("b3").Value & " , " & Range("b2").Value & " , count(*) as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & ""
'
'strsql = "transform count(*) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b3").Value & ""
'
'strsql = "transform count(*) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " , " & Range("b2").Value & " pivot " & Range("b2").Value & ""
'
'strsql = "transform count(*) select " & Range("b3").Value & " as 统计 from (" & strtotal & ") group by " & Range("b3").Value & " pivot " & Range("b2").Value & ""
'
'strsql = "transform count(*) select " & Range("b2").Value & " as 统计 from (" & strtotal & ") group by " & Range("b2").Value & " pivot " & Range("b3").Value & ""

End If

rs.Open (strsql), cnn
Cells(5, 1).CopyFromRecordset cnn.Execute(strsql)

For Each Field In rs.Fields
aa = Field.Name
[a4].Offset(0, i) = Field.Name
i = i + 1
Next

Set rs = Nothing
Set cnn = Nothing

Else

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

End If

lst = Range("a1048576").End(xlUp).Row
If Range("b2") = "月份维度" Then

Range("A5:A" & lst).Select
Selection.NumberFormatLocal = "yyyy""-""m"
Range("A4:afd4").Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("项目状态查询").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("项目状态查询").AutoFilter.Sort.SortFields.Add Key:=Range _
("A4"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("项目状态查询").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

ElseIf Range("b2") = "周期维度" Then
'Selection.NumberFormatLocal = "0""周"""
Range("A5:A" & lst).Select
Selection.NumberFormatLocal = "0""周"""
Range("A4:afd4").Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("项目状态查询").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("项目状态查询").AutoFilter.Sort.SortFields.Add Key:=Range _
("A4"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("项目状态查询").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

End If

End Sub

VBA+SQL transform pivot union联合查询的基础应用的更多相关文章

  1. [办公自动化] 再读《让EXCEL飞》(从excel导入access数据时,union联合查询,数据源中没有包含可见的表格)

    一年多以前就买了@Mrexcel的<让excel飞>这本书.整体思路是利用access结合excel,大幅度提高数据分析效率. 最近又拿出来看了看.第十五章,比高级筛选更“高级”,P241 ...

  2. SQL server多表联合查询

    参考网址: https://blog.csdn.net/zou15093087438/article/details/79226394 1. 外连接可分为:左连接.右连接.完全外连接. a.  左连接 ...

  3. SqlSever基础 union 联合查询,厉害的并集 重复项只显示一个 两个查询结果并在一起后排序

    镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...

  4. SQL Server 使用union all查询多个条件数据合并分组显示,同比统计

    ),a.created_yearmonth,) created_yearmonth, a.countaccount countaccount, a.yxsl yxsl, a.sccdsl sccdsl ...

  5. laravel4.2 union联合,join关联分组查询最新记录时,查询条件不对,解决方案

    需求: 分组联合查询,或者最新记录. 问题:  mysql分组的时候默认会查询第一条记录,存在gourp by时 order by 无效. 一般解决办法就是 ,select * from ( sele ...

  6. SQL in优化将In转化为联合查询

    in查询有时候会非常影响性能,最好能转化为联合查询,但有的网友说sqlserver会自动将in转化为联合查询,但我实际遇到的有时候却不是这样.所以最好还是不要用in. 我自己的例子,用in的时候耗费了 ...

  7. SQL语句(六)分页查询和联合查询

    目录 一.分页查询 语法格式 应用 二.联合查询 语法和作用 特点 应用 UNION和UNION ALL的区别 一.分页查询 语法格式 SELECT 查询列表 FROM 表 WHERE ... GRO ...

  8. MySQL开发——【联合查询、多表连接、子查询】

    联合查询 所谓的联合查询就是将满足条件的结果进行拼接在同一张表中. 基本语法: select */字段 from 数据表1 union [all | distinct] select */字段 fro ...

  9. (五)连接查询(SQL99标准)、子查询、分页查询、联合查询

    一.连接查询(SQL99标准) 1.含义:当要查询的数据来自多张表时要使用连接查询 2.语法: select 查询列表 from 表1 别名 [连接类型] join 表2 别名 on 连接条件 [wh ...

随机推荐

  1. cordova插件值 二维码扫描

    插件地址 https://github.com/gizwits/cordova-gizwits-scan-qrcode 插件安装方式 cordova plugin add https://github ...

  2. 案例-3D旋转木马

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. sum - 计算文件的校验和,以及文件占用的块数

    总览 (SYNOPSIS) ../src/sum [OPTION]... [FILE]... 描述 (DESCRIPTION) 显示 每个 文件 FILE 的 校验和, 以及 他们 占用的 块数. - ...

  4. Python 基础 2-1 列表入门

    引言 列表 list 是由一系列按照特定顺序排列的元素组成的,它是一种有序的数据集合. 你可以添加任何类型的元素到列表中,其中的元素之间可以没有任何关系. 列表简介 Python 使用方括号 [] 来 ...

  5. mysql数据库用户权限设置

    设置用户权限:格式:grant 权限列表 on 数据库名.表名 to '用户名'@'来源地址' identified by '密码'; * 权限列表:用于列出授权的各种数据库操作,通过逗号进行分割,如 ...

  6. jeesite框架常用插件

    1.分页: <div class="pagination">${page }</div> 2.日历:onclick="WdatePicker({d ...

  7. 查看git HEAD

    如果想看 HEAD 指向,可以通过 cat .git/HEAD 查看, 如果 HEAD 指向的是一个引用,还可以用 git symbolic-ref HEAD 查看它的指向.

  8. Dart编程实例 - 相等和关系操作符

    Dart编程实例 - 相等和关系操作符 void main() { var num1 = 5; var num2 = 9; var res = num1>num2; print('num1 gr ...

  9. Python:验证码识别

    说明:此验证方法很弱,几乎无法识别出正确的验证码  

  10. APICloud框架——获取本地图片信息

    api.getPicture 获取本地图片放置到服务器上或者在app中预览是app的基本功能,今天使用了APICloud框架的api.getPicture这个api获取到的本地图片预览在app中,就像 ...