Sql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joel

    #1

    Sql


    Hi,

    What's the syntax for Selecting rows by a predefined index?

    Here's the statement:
    strsql = "Select * From Invt Where (Part_Id > '" & Replace(txtAddI temNumber.Text, "'", ")") & "') Order By Part_Id"
    Where Part_Id is a defined index in the Mysql table I get an error.

    What is the proper syntax

    Thank you
  • Bill Karwin

    #2
    Re: Sql

    Joel wrote:
    [color=blue]
    > What's the syntax for Selecting rows by a predefined index?
    >
    > Here's the statement:
    > strsql = "Select * From Invt Where (Part_Id > '" &
    > Replace(txtAddI temNumber.Text, "'", ")") & "') *Order By Part_Id*"
    > Where Part_Id is a defined index in the Mysql table I get an error.
    >
    > What is the proper syntax[/color]

    One doesn't use an index name in the order by clause. One uses the name
    of a physical column, or derived column named in this select query. If
    that column has an index defined for it, MySQL is smart enough to use
    the index (if possible).

    Regards,
    Bill K.

    Comment

    Working...