Re: select on set yields exponential notation

2004-02-07 Thread Michael Stassen
Ah, I see. Of course. And adding 0 is exactly what the manual says to do. I was about to reply to say that |0 works where +0 does not when Bernard sent his excellent suggestion to cast as unsigned. Then I spent a while trying to figure out why you got such a large number for '40'. I

select on set yields exponential notation

2004-02-06 Thread Greg Vines
I'm trying to select all the fields from a set but when the number is large, it is returned in exponential notation. Is there a way to keep the returned number an integer? Example: create simple table: create table test1( var1 int, var2 set(1,2,3,4,5,6,7,8,9,10,

Re: select on set yields exponential notation

2004-02-06 Thread Michael Stassen
Why are you adding 0? Try this: SELECT var1, var2 FROM test1; Michael Greg Vines wrote: I'm trying to select all the fields from a set but when the number is large, it is returned in exponential notation. Is there a way to keep the returned number an integer? Example: create simple table:

Re: select on set yields exponential notation

2004-02-06 Thread Greg Vines
With sets if you select the set, you get a comma delimited list, but if you add zero, you get the number value of the entire set (which is what I want). The response is not always in exponential notation - just when a high order bit is set. This seems to be a problem with the output

Re: select on set yields exponential notation

2004-02-06 Thread Bernard Clement
If you are using 4.0.2 and above you can use cast. mysql select var1,cast(var2 as unsigned) from test1; +--++ | var1 | cast(var2 as unsigned) | +--++ |1 |562949953421312 | |1 | 1 | |1 |

Re: select on set yields exponential notation

2004-02-06 Thread Greg Vines
Thanks Bernard - that fixed it! On Fri, 2004-02-06 at 13:41, Bernard Clement wrote: If you are using 4.0.2 and above you can use cast. mysql select var1,cast(var2 as unsigned) from test1; +--++ | var1 | cast(var2 as unsigned) |