JKL, Igor, Tom
Thank you very much for the advice.
It's very much appreciated and helps A LOT!
Best Regards
Dean
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Kurt, Keith
Thanks very much for your help.
It's very much appreciated.
Best Regards
Dean
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Here it is
tbl itms (std_nm text, raw_nm text)
tbl aliases (std_nm text, raw_nm text)
Id like to whip through table itms which has a blank col std_nm and fill
in as many fields as I can
by
reading each itms' raw_nm fld
finding any matching rec (with the same raw_nm value) in aliases
updating
7:48 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] updating using a value from another table
Here it is
tbl itms (std_nm text, raw_nm text)
tbl aliases (std_nm text, raw_nm text)
Id like to whip through table itms which has a blank col std_nm and fill in as
many fields as I can by reading each
On 7 Oct 2013, at 1:59pm, Rob Richardson rdrichard...@rad-con.com wrote:
gDb eval UPDATE itms SET std_nm=(SELECT std_nm FROM aliases as x WHERE
raw_nm = x.raw_nm);
What happens if you use the SQLite shell tool to open your database and execute
this command ?
Simon.
Simon, Rob
Thanks very much for your responses.
I downloaded and used the shell...it gives the same results
i.e. the first std_itm fld in aliases irrespective of what the value of
raw_fld is in itms
SQLite version 3.8.0.2 2013-09-03 17:11:13
Enter .help for instructions
Enter SQL statements
Subject: Re: [sqlite] updating using a value from another table
Simon, Rob
Thanks very much for your responses.
I downloaded and used the shell...it gives the same results i.e. the first
std_itm fld in aliases irrespective of what the value of raw_fld is in itms
SQLite version 3.8.0.2 2013-09-03
On 7 Oct 2013, at 3:45pm, dean gwilliam mgbg25...@blueyonder.co.uk wrote:
sqlite UPDATE itms SET std_nm=(SELECT std_nm FROM aliases as x WHERE raw_nm
= x
.raw_nm);
looking at it without the 'AS' ...
UPDATE itms SET std_nm=(SELECT std_nm FROM aliases WHERE raw_nm =
aliases.raw_nm);
I'm
RobR
Sorry for the delay...I needed to regenerate the database which took
several minutes and processes after I messed it up. Here's the
completed itms table. I don't understand why sales is written to the
std_nm column
in itms when each rows corresponding raw_nm field does not appear in
Thanks Simon
I tried that but it writes nothing to itms.std_nm
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
I seem to have cracked it with a cut-down example
package require sqlite3
set gDb {}
set db_fl_nm [pwd]\\test.db ;# :memory:
proc mbx {x} {
set answer [tk_messageBox -message $x -type yesno -icon question]
switch -- $answer {
yes {}
no exit
}
}
proc mfl {x} {global
It's not working in my big program though so...
I'll try to see what's different
i.e. I'm getting nothing in itms.std_nm using the test program update query
despite it working in my test program
___
sqlite-users mailing list
sqlite-users@sqlite.org
It's working now
I just needed to use a capital first character in alias.raw_nm.
Now it's working in the big program too.
Simon, Rob...thanks for your help/reassurance
___
sqlite-users mailing list
sqlite-users@sqlite.org
Simon Slavin slav...@bigfraud.org wrote:
On 7 Oct 2013, at 3:45pm, dean gwilliam mgbg25...@blueyonder.co.uk wrote:
sqlite UPDATE itms SET std_nm=(SELECT std_nm FROM aliases as x WHERE
raw_nm = x
.raw_nm);
looking at it without the 'AS' ...
UPDATE itms SET std_nm=(SELECT std_nm FROM
On Mon, 07 Oct 2013 12:48:10 +0100
dean gwilliam mgbg25...@blueyonder.co.uk wrote:
Here's my miserable attempt
gDb eval UPDATE itms SET std_nm=(SELECT std_nm FROM aliases as x
WHERE raw_nm = x.raw_nm);
Oh, so close!
An update statement without a WHERE clause updates the whole table.
In
On 10/7/2013 7:41 PM, James K. Lowden wrote:
On Mon, 07 Oct 2013 12:48:10 +0100
dean gwilliam mgbg25...@blueyonder.co.uk wrote:
Here's my miserable attempt
gDb eval UPDATE itms SET std_nm=(SELECT std_nm FROM aliases as x
WHERE raw_nm = x.raw_nm);
Oh, so close!
An update statement without a
: [sqlite] updating using a value from another table
Here it is
tbl itms (std_nm text, raw_nm text)
tbl aliases (std_nm text, raw_nm text)
Id like to whip through table itms which has a blank col std_nm and fill
in as many fields as I can
by
reading each itms' raw_nm fld
finding any matching rec
Igor Tandetnik-2 wrote
Or alternatively, without a WHERE clause:
update a set i = coalesce((select i from b where b.a = a.a), i);
What I have used similar to this is:
UPDATE a SET i = ifnull((select i from b where b.a = a.a), i);
Tom
--
View this message in context:
18 matches
Mail list logo