> Was this intended as part of the division discussion? > If so, the original statement was:
> > Am I alone in thinking that a division operator that does > > different things depending on the declared datatype of a > > column is an abomination? Yes. It was in answer to (paraphrased), "what results do other DBs return for the SQL under consideration?" Looks like I forgot to include the question with the answer. Sorry about that :-) -Clark ----- Original Message ---- From: Jay Sprenkle <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org; Clark Christensen <[EMAIL PROTECTED]> Sent: Wednesday, November 02, 2005 9:29:13 AM Subject: Re: [sqlite] Proposed 3.3.0 changes. Was: 5/2==2 On 11/2/05, Clark Christensen <[EMAIL PROTECTED]> wrote: > > > ----- Original Message ---- > From: [EMAIL PROTECTED] > To: sqlite-users@sqlite.org > Sent: Wednesday, November 02, 2005 07:36:58 > Subject: Re: [sqlite] Proposed 3.3.0 changes. Was: 5/2==2 > > Consider the following SQL: > > CREATE TABLE t1(a INTEGER, b REAL); > INSERT INTO t1 VALUES(5,5); > SELECT a/2, b/2 FROM t1; > > D. Richard Hipp <[EMAIL PROTECTED]> > --- > > Connected to: > Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production > With the Partitioning option > JServer Release 8.1.6.0.0 - Production > > SQL> create table t1 (a integer, b real); > > Table created. > > SQL> insert into t1 values (5,5); > > 1 row created. > > SQL> select a/2, b/2 from t1; > > A/2 B/2 > ---------- ---------- > 2.5 2.5 > Was this intended as part of the division discussion? If so, the original statement was: > Am I alone in thinking that a division operator that does > different things depending on the declared datatype of a > column is an abomination? This shows that the engine does do different things based on the data type. It changed the result type so it would not lose precision. If you require all divisions to be done the same way then you must have only one numerical type. Floating point.