Syntax for select statement returning output?

Syntax for select statement returning output?

am 06.06.2006 13:50:31 von luvic.vangool

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.

Re: Syntax for select statement returning output?

am 15.06.2006 11:54:06 von Bart Van der Donck

luvic.vangool@gmail.com wrote:

> 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?

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