table a: dict_base
table b: dict_user
condition: wether 'sz_word' = 'X' increase the value of 'dw_uses' by 1

sz_word could be in either table, dw_uses must be updated on the pertinent 
table/s though.

Sorry for not being too clear :)

Thanks again


----- Original Message ----- 
From: "Fowler, Jeff" <[EMAIL PROTECTED]>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Sent: Monday, February 04, 2008 4:59 PM
Subject: Re: [sqlite] Update value from either database table?


> Without more info, here's the general approach:
>
> UPDATE c
> SET int_field = int_field+1
> WHERE (table a condition) OR (table b condition)
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Gussimulator
> Sent: Monday, February 04, 2008 1:57 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Update value from either database table?
>
> I have a field I need to update given a condition, but I don't know
> wether the condition occurs in table A or table B, how can I perform
> this query?
>
> I have 2 identical tables in design, but one contains system data and
> the other one contains user data... On my update routine (in C) I have
> to increase an INTEGER field from either table given a condition... The
> thing is, the condition could be present on both tables... what should I
> do??
>
> Thanks!
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to