Syntax for select statement returning output?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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

Many thanks for your help!


Re: Syntax for select statement returning output? wrote:

Quoted text here. Click to load it

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

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

Hope this helps,


Site Timeline