标题:SQL语句问题
取消只看楼主
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1817
专家分:3681
注 册:2011-3-24
结帖率:98.24%
已结贴  问题点数:20 回复次数:1 
SQL语句问题
底下SQL查询语法中的 as A 和 as B 是什么意思?
为什么A和B不用定义就能用?

程序代码:
    Private Sub LoadFileList(ByVal strSubjectNo As String, ByVal strSubFolderNo As String)
        Dim mySQL As String
        mySQL = "SELECT ROW_NUMBER() OVER (" & hdfFileListOrderBy.Value & ") AS RowNo, A.*, B.EmployeeName AS ReviserName FROM tblFileList AS A "
        mySQL += "LEFT OUTER JOIN tblMstEmployee AS B ON A.ReviserNo = B.EmployeeNo "
        mySQL += "WHERE A.SubjectNo = '" & strSubjectNo & "' AND A.SubFolderNo = " & strSubFolderNo
        If lblFileMgnTitleChi.Text <> "内部下载" Then
            mySQL += "AND A.ShowInPublic = 'Y'"
        End If
        Try
            Using mySqlDS As SqlDataSource = New SqlDataSource
                mySqlDS.ProviderName = strDbType
                mySqlDS.ConnectionString = WebConfigurationManager.ConnectionStrings(strCnnType & "DbBTA").ConnectionString
                mySqlDS.SelectCommand = mySQL
                mySqlDS.DataSourceMode = SqlDataSourceMode.DataSet
                Dim my_args As New DataSourceSelectArguments
                Dim my_DV As Data.DataView = mySqlDS.Select(my_args)
                lvFileList.DataSource = my_DV
                lvFileList.DataBind()
            End Using
        Catch ex As Exception
            Dim strErr As String = "●●● 程式错误讯息如下 ●●●" & "\n\n" & Replace(Replace(Replace(Replace(Trim(ex.ToString()), Chr(10), ""), Chr(13), ""), "\", "\\"), "'", "\'")
            ScriptManager.RegisterStartupScript(Me, Me.GetType(), "alert", "alert('" & strErr & "');", True)
        End Try
    End Sub



搜索更多相关主题的帖子: SQL String mySQL End Replace 
2017-05-08 13:17
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1817
专家分:3681
注 册:2011-3-24
得分:0 
原来如此


不要選我當版主
2017-05-10 11:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-476797-1-1.html




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

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