469,924 Members | 1,392 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,924 developers. It's quick & easy.

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.

Jun 6 '06 #1
1 1395
lu***********@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

Jun 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

699 posts views Thread by mike420 | last post: by
4 posts views Thread by Jarrod Morrison | last post: by
2 posts views Thread by Not Me | last post: by
1 post views Thread by dmalhotr2001 | last post: by
1 post views Thread by Sandesh | last post: by
5 posts views Thread by =?Utf-8?B?QW5kcmV3?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.