Hi,

MySQL lets you do a select without any tables,
i.e., without the from-clause.
So,

select 3;

returns one row, one column, value 3. 

To put a value into a variable (you mean the @a -style variables?),
you can either

select @a := 3;

or

set @a := 3;


And yes, if you want to do it the Oracle way,
why not just define a table called DUAL and put one row in it?

create table DUAL ( ID tinyint unsigned not null primary key ) max_rows=1;
insert into DUAL values ( 1 );

Hope this helps.


Jan



"M. A. Ould-Beddi" wrote:
> 
> I know that in Oracle it is possible to select a number
> from DUAL and put it in a variable. Is it possible
> In mysql? and how?
> 
> Thanks
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to