| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2065 人关注过本帖
标题:这段是在写什么?
只看楼主 加入收藏
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
结帖率:97.66%
收藏
 问题点数:0 回复次数:2 
这段是在写什么?
晕倒了...

程序代码:
Private Function GetExcelSQL(ByVal blFCSTOrder As Boolean) As String
        Dim mySQL As String
        Dim strColorIndex As String
        Dim strColorIndexJoinTable As String
        If blFCSTOrder = True Then
            strColorIndex = "ISNULL(D.Priority, 4) AS ColorIndex"
            strColorIndexJoinTable = "LEFT OUTER JOIN tblBasStatusDesc AS G ON D.Priority = G.Status AND G.Category = 'ProjectFCST' "
        Else
            strColorIndex = "ISNULL(A.Phase, 10) AS ColorIndex"
            strColorIndexJoinTable = "LEFT OUTER JOIN tblBasStatusDesc AS G ON A.Phase = G.Status AND G.Category = 'ProjectPhase' "
        End If
        mySQL = "SELECT * FROM ("
        mySQL += "SELECT A.ProjectNo, A.NPINumber, A.DevpType, A.ProjectType, A.CustomerNo, A.DeviceNo, A.Platform01, A.Platform02, A.Platform03, A.ProductType, A.RequestService, A.Div, "
        mySQL += "A.EngineerNo, A.ConsultantNo, A.SupervisorNo, A.SalesNo, A.ApplicationDate, A.KickoffDate, A.EstFinishDate, A.DepartmentNo, A.Remark, A.ReleaseStatus, A.ReleaseStatusDate, "
        mySQL += "A.Phase, A.PhaseDate, "
        mySQL += "B.ProbeCard, B.ProbeCardPlanFrom, B.ProbeCardPlanTo, B.ProbeCardPlanRevise, B.ProbeCardActualFrom, B.ProbeCardActualTo, B.ProbeCardActualRevise, B.ProbeCardActualReady, B.ProbeCardHours, B.ProbeCardMemo, "
        mySQL += "B.DutBoard, B.DutBoardPlanFrom, B.DutBoardPlanTo, B.DutBoardPlanRevise, B.DutBoardActualFrom, B.DutBoardActualTo, B.DutBoardActualRevise, B.DutBoardActualReady, B.DutBoardHours, B.DutBoardMemo, "
        mySQL += "B.ChangeKit, B.ChangeKitPlanFrom, B.ChangeKitPlanTo, B.ChangeKitPlanRevise, B.ChangeKitActualFrom, B.ChangeKitActualTo, B.ChangeKitActualRevise, B.ChangeKitHours, B.ChangeKitMemo, "
        mySQL += "B.TestProgram, B.TestProgramPlanFrom, B.TestProgramPlanTo, B.TestProgramPlanRevise, B.TestProgramActualFrom, B.TestProgramActualTo, B.TestProgramActualRevise, B.TestProgramActualReady, B.TestProgramHours, B.TestProgramMemo, "
        mySQL += "B.LaserRepair, B.LaserRepairPlanFrom, B.LaserRepairPlanTo, B.LaserRepairPlanRevise, B.LaserRepairActualFrom, B.LaserRepairActualTo, B.LaserRepairActualRevise, B.LaserRepairHours, B.LaserRepairMemo, "
        mySQL += "B.TPVerification, B.TPVerificationPlanFrom, B.TPVerificationPlanTo, B.TPVerificationPlanRevise, B.TPVerificationActualFrom, B.TPVerificationActualTo, B.TPVerificationActualRevise, B.TPVerificationActualReady, B.TPVerificationHours, B.TPVerificationMemo, "
        mySQL += "B.Correlation, B.CorrelationPlanFrom, B.CorrelationPlanTo, B.CorrelationPlanRevise, B.CorrelationActualFrom, B.CorrelationActualTo, B.CorrelationActualRevise, B.CorrelationHours, B.CorrelationMemo, "
        mySQL += "B.ReleaseMeeting, B.ReleaseMeetingPlanFrom, B.ReleaseMeetingPlanTo, B.ReleaseMeetingPlanRevise, B.ReleaseMeetingActualFrom, B.ReleaseMeetingActualTo, B.ReleaseMeetingActualRevise, B.ReleaseMeetingHours, B.ReleaseMeetingMemo, "
        mySQL += "C.TestRate, C.CUP, C.TGResolution, C.Site, C.Channel, C.Temperature, C.AddOnModule, C.VM, C.TransInTester, C.ProductTypeDesc1, C.ProductTypeDesc2, "
        mySQL += "C.DevpCategory, C.MixSignal, C.WaferInch, C.ProbeCardNo, C.DutBoardNo, C.PadCount, C.NiddleCount, C.DataCollectDate, C.PackageType, C.PackageType2, "
        mySQL += "D.FCST, D.Schedule AS FCSTSchedule, D.Priority, ISNULL(D.Priority, 4) AS FCSTOrder, "
        mySQL += "E.FormDate, E.FirstLot, E.SecondLot, E.ThirdLot, E.FineTune, E.FTSec, E.CPSec, "
        mySQL += "F.CustomerEngSName, F.CustomerChiSName, "
        mySQL += strColorIndex & ", G.StatusDesc AS PhaseDesc "
        mySQL += "FROM tblProject AS A INNER JOIN tblProjectWorkPlan AS B ON A.ProjectNo = B.ProjectNo "
        mySQL += "LEFT OUTER JOIN tblProjectProductInfo AS C ON A.ProjectNo = C.ProjectNo "
        mySQL += "LEFT OUTER JOIN tblProjectFCST AS D ON A.ProjectNo = D.ProjectNo "
        mySQL += "LEFT OUTER JOIN tblProjectReleaseLots AS E ON A.ProjectNo = E.ProjectNo "
        mySQL += "LEFT OUTER JOIN tblMstCustomerPublic F ON A.CustomerNo = F.CustomerNo "
        mySQL += strColorIndexJoinTable
        mySQL += "WHERE "
        If radReportTD.Checked = True Then
            mySQL += "A.DevpType = 'TD' "
        Else
            mySQL += "A.DevpType = '客戶' "
        End If
        mySQL += "AND A.ReleaseStatus < 4) AS myTable "
        mySQL += hdfSort.Value
        Return mySQL
    End Function
搜索更多相关主题的帖子: String mySQL JOIN If LEFT 
2017-05-15 12:55
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
收藏
得分:0 
帮忙翻译解释一下这在写什么?

程序代码:
SELECT * FROM (SELECT A.ProjectNo, A.NPINumber, A.DevpType, A.ProjectType, A.CustomerNo, A.DeviceNo, A.Platform01, A.Platform02, A.Platform03, A.ProductType, 
A.RequestService, A.Div, A.EngineerNo, A.ConsultantNo, A.SupervisorNo, A.SalesNo, A.ApplicationDate, A.KickoffDate, A.EstFinishDate, A.DepartmentNo, A.Remark, 
A.ReleaseStatus, A.ReleaseStatusDate, A.Phase, A.PhaseDate, B.ProbeCard, B.ProbeCardPlanFrom, B.ProbeCardPlanTo, B.ProbeCardPlanRevise, B.ProbeCardActualFrom, 
B.ProbeCardActualTo, B.ProbeCardActualRevise, B.ProbeCardActualReady, B.ProbeCardHours, B.ProbeCardMemo, B.DutBoard, B.DutBoardPlanFrom, B.DutBoardPlanTo, 
B.DutBoardPlanRevise, B.DutBoardActualFrom, B.DutBoardActualTo, B.DutBoardActualRevise, B.DutBoardActualReady, B.DutBoardHours, B.DutBoardMemo, B.ChangeKit, 
B.ChangeKitPlanFrom, B.ChangeKitPlanTo, B.ChangeKitPlanRevise, B.ChangeKitActualFrom, B.ChangeKitActualTo, B.ChangeKitActualRevise, B.ChangeKitHours, 
B.ChangeKitMemo, B.TestProgram, B.TestProgramPlanFrom, B.TestProgramPlanTo, B.TestProgramPlanRevise, B.TestProgramActualFrom, B.TestProgramActualTo, 
B.TestProgramActualRevise, B.TestProgramActualReady, B.TestProgramHours, B.TestProgramMemo, B.LaserRepair, B.LaserRepairPlanFrom, B.LaserRepairPlanTo, 
B.LaserRepairPlanRevise, B.LaserRepairActualFrom, B.LaserRepairActualTo, B.LaserRepairActualRevise, B.LaserRepairHours, B.LaserRepairMemo, B.TPVerification, 
B.TPVerificationPlanFrom, B.TPVerificationPlanTo, B.TPVerificationPlanRevise, B.TPVerificationActualFrom, B.TPVerificationActualTo, B.TPVerificationActualRevise, 
B.TPVerificationActualReady, B.TPVerificationHours, B.TPVerificationMemo, B.Correlation, B.CorrelationPlanFrom, B.CorrelationPlanTo, B.CorrelationPlanRevise, 
B.CorrelationActualFrom, B.CorrelationActualTo, B.CorrelationActualRevise, B.CorrelationHours, B.CorrelationMemo, B.ReleaseMeeting, B.ReleaseMeetingPlanFrom, 
B.ReleaseMeetingPlanTo, B.ReleaseMeetingPlanRevise, B.ReleaseMeetingActualFrom, B.ReleaseMeetingActualTo, B.ReleaseMeetingActualRevise, B.ReleaseMeetingHours, 
B.ReleaseMeetingMemo, C.TestRate, C.CUP, C.TGResolution, C.Site, C.Channel, C.Temperature, C.AddOnModule, C.VM, C.TransInTester, C.ProductTypeDesc1, 
C.ProductTypeDesc2, C.DevpCategory, C.MixSignal, C.WaferInch, C.ProbeCardNo, C.DutBoardNo, C.PadCount, C.NiddleCount, C.DataCollectDate, C.PackageType, 
C.PackageType2, D.FCST, D.Schedule AS FCSTSchedule, D.Priority, ISNULL(D.Priority, 4) AS FCSTOrder, E.FormDate, E.FirstLot, E.SecondLot, E.ThirdLot, E.FineTune, 
E.FTSec, E.CPSec, F.CustomerEngSName, F.CustomerChiSName, ISNULL(A.Phase, 10) AS ColorIndex, 
G.StatusDesc AS PhaseDesc FROM tblProject AS A 
INNER JOIN tblProjectWorkPlan AS B ON A.ProjectNo = B.ProjectNo 
LEFT OUTER JOIN tblProjectProductInfo AS C ON A.ProjectNo = C.ProjectNo 
LEFT OUTER JOIN tblProjectFCST AS D ON A.ProjectNo = D.ProjectNo 
LEFT OUTER JOIN tblProjectReleaseLots AS E ON A.ProjectNo = E.ProjectNo 
LEFT OUTER JOIN tblMstCustomerPublic F ON A.CustomerNo = F.CustomerNo 
LEFT OUTER JOIN tblBasStatusDesc AS G ON A.Phase = G.Status AND G.Category = 'ProjectPhase' WHERE A.ReleaseStatus < 4) AS myTable

不要選我當版主
2017-06-06 17:14
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:0 
数据库
A.XXX  B.XXX C.XXX 这里ABC 都是数据库里面的表名称 XXX是具体的字段名称  剩下的SELECT * FROM 啥的都是sql语句

DO IT YOURSELF !
2017-06-06 17:54
快速回复:这段是在写什么?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021965 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved