On 31 May 2013, at 4:38pm, "Dave Wellman" <[email protected]> wrote:
> select stepid ,'STEPID'||stepid ,stepid+5 ,'STEPID'||stepid+5
> ,'STEPID'||5
>
> from seqnumber;
>
>
>
> A B C D E
>
> 5|STEPID5|10|5|STEPID5
Interesting:
SQLite version 3.7.12 2012-04-03 19:43:07
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE myTable (stepint INTEGER, steptext TEXT);
sqlite> INSERT INTO myTable VALUES (5,'5');
sqlite> SELECT * FROM myTable;
sqlite> SELECT 'hello mum'||stepint+5,'hello mum'||steptext+5 FROM myTable;
5|5
sqlite> SELECT ('hello mum'||stepint)+5,('hello mum'||steptext)+5 FROM myTable;
5|5
sqlite> SELECT 'hello mum'||(stepint+5),'hello mum'||(steptext+5) FROM myTable;
hello mum10|hello mum10
sqlite> SELECT 'hello mum'+stepint,'hello mum'+steptext FROM myTable;
5|5
sqlite> SELECT 'hello mum'+'hello mum' FROM myTable;
0
Okay, so the '+' operator, when either of the operators is text, considers the
text to evaluate to 0. Not sure what I expected.
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users