当表名包含空格时,MySQL Fiddle语法错误

时间:2016-03-01 01:14:21

标签: mysql

我正在尝试为课程构建架构,但我明白了:

  

您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以便使用接近' NULL,Apartment INTEGER NULL,City'在第4行。

这是我的代码:

Sub Tester()
    Dim c As Range, col As Collection, el

    For Each c In Range("A1:A3")

        Set col = FindAllMatches(Range("D1:D5"), c.Value)
        For Each el In col
            Debug.Print c.Address & " matched " & el.Address
        Next el

    Next c

End Sub

'Return a collection of all matches for 'txt' in Range 'rng'
'  If no matches then the Count property of the returned collection
'    will  = zero
Function FindAllMatches(rng As Range, txt As String) As Collection
    Dim rv As New Collection, f As Range, addr As String, txtSrch As String
    Dim IsLong As Boolean

    IsLong = Len(txt) > 250
    txtSrch = IIf(IsLong, Left(txt, 250), txt)

   'EDIT1: added the LookIn parameter setting...
    Set f = rng.Find(what:=txtSrch, lookat:=xlPart, _
                     LookIn:=xlValues, MatchCase:=False)
    Do While Not f Is Nothing
        If f.Address(False, False) = addr Then Exit Do
        If Len(addr) = 0 Then addr = f.Address(False, False)
        If Not IsLong Then
            rv.Add f 'always add
        Else
            'check for the *full* value
            'EDIT2: make the Instr case-insensitive
             If InStr(1, f.Value, txt, vbTextCompare) > 0 Then rv.Add f
        End Id

        Set f = rng.FindNext(after:=f)
    Loop
    Set FindAllMatches = rv
End Function

1 个答案:

答案 0 :(得分:0)

  • 有两个表具有相同的名称。
  • 一些“,”使用“。”溢出。
  • 缺少“,”溢出
  • 表名是否包含空格?

我认为如果你解决了上述问题,那就没关系了。