Syntax for select statement returning output?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • luvic.vangool@gmail.com

    #1

    Syntax for select statement returning output?

    Hi,

    I'm fairly new to MySql and come from a MS SQL background.
    I have an application that I am converting from MS SQL to MySql.

    I need to return a value from MySql using a parameter.

    In MS SQL my select statement is:
    "select @id = id from database"

    That doesn't seem to be working with MySql... does anyone have any
    suggestions?

    Many thanks for your help!

    Luvic.

  • Bart Van der Donck

    #2
    Re: Syntax for select statement returning output?

    luvic.vangool@g mail.com wrote:
    [color=blue]
    > I'm fairly new to MySql and come from a MS SQL background.
    > I have an application that I am converting from MS SQL to MySql.
    >
    > I need to return a value from MySql using a parameter.
    >
    > In MS SQL my select statement is:
    > "select @id = id from database"
    >
    > That doesn't seem to be working with MySql... does anyone have any
    > suggestions?[/color]

    You can't select something from a database in MySQL, but only from a
    table.

    In order to use your SQL statement, you would first need to choose the
    database you wish to work with on the MySQL server, and then execute
    something like this:

    SELECT id FROM sometable;

    The MySQL manual is at http://dev.mysql.com/doc/.

    Hope this helps,

    --
    Bart

    Comment

    Working...