Re: Select from dual?
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
AW: Antwort: Select from dual?
DUAL is a dummy table in oracle ... ! In mysql you have two way to set variables: 1. set them directly via SET @variable={ integer expression | real expression | string expression }[,@variable= ...]. 2. or do something like select @variable:={ integer expression | real expression | string expression } you can read it out in the manual: http://www.mysql.com/documentation/mysql/bychapter/manual_toc.html#Variables > -Ursprungliche Nachricht- > Von: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Gesendet: Donnerstag, 1. Marz 2001 10:54 > An: M. A. Ould-Beddi > Cc: [EMAIL PROTECTED] > Betreff: Antwort: Select from dual? > > > > On 01.03.2001 10:46:33 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 > > ??? What's DUAL? > > > > - > 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
Antwort: Select from dual?
On 01.03.2001 10:46:33 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 ??? What's DUAL? - 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
Select from dual?
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