Re: [sqlite] random() function does not keep value in subquery

2010-12-30 Thread Guy (Hotmail)
the hole explanation is: I modified your select a bitt get a result for the random() function sqlite> select b,a, b & a from (select random() as b, 65535 as a); -3252060536130257049|65535|48999 So I got these results b = -3252060536130257049 in decimal form b = 110100101100010111101

Re: [sqlite] random() function does not keep value in subquery

2010-12-30 Thread Igor Tandetnik
Oliver Peters wrote: > Drake Wilson writes: > > [...] > >> sqlite> select a, a+1 from (select random() & 65535 as a); >> a a+1 >> 39692 39693 > > [...] > > I'm just a little curious: what is the meaning of the & operator? Bitwise AND, just like in C. > What is its effect? In

Re: [sqlite] random() function does not keep value in subquery

2010-12-30 Thread Oliver Peters
Drake Wilson writes: [...] > sqlite> select a, a+1 from (select random() & 65535 as a); > a a+1 > 39692 39693 [...] I'm just a little curious: what is the meaning of the & operator? What is its effect? I'm not a C programmer so a simple explanation would help me to understand. g

Re: [sqlite] random() function does not keep value in subquery

2010-12-30 Thread Drake Wilson
Quoth "smiths...@essess.org.uk" , on 2010-12-29 20:11:34 +: > In this instance above clearly random() function has been called more than > once, > as character 1 and character 2 are not part of the 'l2' string being analyzed. Confirmed behavior in SQLite 3.7.4 from Debian unstable. (I'm not