Thank you Simon and Igor for suggesting the cast() - that works without
me having to change anything! And of course I appreciate everyone's
replies as well.
Dennis
___
sqlite-users mailing list
sqlite-users@sqlite.org
"Dennis Volodomanov" <[EMAIL PROTECTED]>
wrote in message news:[EMAIL PROTECTED]
> Funny enough, but it doesn't work on real data using v3.6.1...
>
> Here's the table:
>
> sqlite> .dump test_table
> BEGIN TRANSACTION;
> CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID2 INTEGER,
>
Not sure about replacing the collation sequence - does not sound
easier than recreating the table.
You could just add a view:
sqlite> CREATE TABLE test_table (ID INTEGER PRIMARY KEY,
...> ExternalID2 INTEGER,
...> ExternalID INTEGER,
...>
> Declaring the column as integer does not prevent you from storing strings:
>
>
Yes, except for a small problem of updating all live databases with the
new column type. I don't think I can update the column type without
recreating the table, right? It's not hard, so if it comes down to
Hi Dennis,
Declaring the column as integer does not prevent you from storing strings:
SQLite version 3.6.0
Enter ".help" for instructions
sqlite> BEGIN TRANSACTION;
sqlite> CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID2 INTEGER,
...> ExternalID
...> INTEGER, Value INTEGER);
> Works just fine with 3.6.1 if you declare the Value column to be
> INTEGER. As it is, I have no idea what collation is used, but the
> Value column will be declared to default to TEXT values, as shown by
>
> select typeof(value) from test_table;
>
I haven't tried that, but I cannot declare it
Dennis Volodomanov wrote:
Funny enough, but it doesn't work on real data using v3.6.1...
Here's the table:
sqlite> .dump test_table
BEGIN TRANSACTION;
CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID2 INTEGER,
ExternalID
INTEGER, Value );
INSERT INTO "test_table"
Funny enough, but it doesn't work on real data using v3.6.1...
Here's the table:
sqlite> .dump test_table
BEGIN TRANSACTION;
CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID2 INTEGER,
ExternalID
INTEGER, Value );
INSERT INTO "test_table" VALUES(1007,1,37,'-5');
INSERT INTO
I've got 3.6.0 and it works fine here
On Thu, Aug 14, 2008 at 9:09 PM, Dennis Volodomanov
<[EMAIL PROTECTED]> wrote:
>> I'm using 3.3.5, I'll get the latest and see if works there or not in
> a
>> few minutes.
>
> Ok, it works in 3.6.1 - sorry for the troubles... I'll just upgrade the
> program
> Could it be that since you're not defining a type for Data it assumes
> string?
> Try creating the table with
> id integer, externalid integer, data number (or numeric)
That Data column could contain anything (int, double, string), it'll be
up to the application's logic to only get Data for
Could it be that since you're not defining a type for Data it assumes string?
Try creating the table with
id integer, externalid integer, data number (or numeric)
On Thu, Aug 14, 2008 at 7:00 PM, Dennis Volodomanov
<[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I've tried a few SQL statements, but
> What version of SQLite are you using? I'm using the 3.5.7 version
that
> came
> with OS X 10.5, and I get -2 as expected.
I'm using 3.3.5, I'll get the latest and see if works there or not in a
few minutes.
> Also, what's with the superfluous subquery? Why not just say
>
> SELECT max(Data)
On Thu, Aug 14, 2008 at 9:45 PM, Dennis Volodomanov <
[EMAIL PROTECTED]> wrote:
> > Seems to work ok for me. What values were you expecting?
>
> Yes, that works. Bad example on my part, sorry.
>
> What doesn't work is this:
>
> 1|2|-7
> 2|2|-5
> 3|2|-20
> 4|2|-5
> 5|2|-2
>
> SELECT max(Data) FROM
> Seems to work ok for me. What values were you expecting?
Yes, that works. Bad example on my part, sorry.
What doesn't work is this:
1|2|-7
2|2|-5
3|2|-20
4|2|-5
5|2|-2
SELECT max(Data) FROM (SELECT Data FROM test_table WHERE ExternalID=2);
This returns a -5, while I'm expecting a -2.
Thank
On Fri, Aug 15, 2008 at 1:00 AM, Dennis Volodomanov
<[EMAIL PROTECTED]> wrote:
> Suppose I have a table like this:
>
> CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID, Data);
>
> And some contents:
>
> 1| 2| -7
> 2| 2| 5
> 3| 1| 0
> 4| 2| -20
> 5| 2| -5
> 6| 2| 1
> 7| 1| 10
>
> Now,
Hello all,
I've tried a few SQL statements, but can't seem to get it to work
properly, so I'd like to ask your help.
Suppose I have a table like this:
CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID, Data);
And some contents:
1| 2| -7
2| 2| 5
3| 1| 0
4| 2| -20
5| 2| -5
6| 2| 1
7|
16 matches
Mail list logo