Update inner join set a = B in access

Source: Internet
Author: User

Databasewrapper dbwrap = new databasewrapper (outputmdbpath); <br/> string x = ""; <br/> List <string> sqllist = new list <string> (); <br/> sqllist. clear (); <br/> // obtain newly added construction land <br/> string xzjsyd = "'watermark', 'watermark', 'dry ary', 'garden ', 'woodland ', 'pasture', 'Agricultural land with facility ', 'rural Road', 'pond Water', 'farmland water conservancy land', 'okan ', 'River Water ', 'Lake Water', 'beach ', 'natural reservation' "; <br/> X =" create table xzjsyd_xp (bsm_1 integer, dlmj double) "; <br/> sqllist. add (x); <br/> X = "insert into xzjsyd_xp (bsm_1, dlmj) Select bsm_1, sum (tbdlmj_xp) * 0.0001 as dlmj from "+ outregtablename +" where dlmc in ("+ xzjsyd +") group by bsm_1 "; <br/> sqllist. add (x); <br/> X = "Update" + name_mzzdjsxm + "A inner join"; <br/> X + = "xzjsyd_xp B "; <br/> X + = "on. BSM = B. bsm_1 set. xzjsyd = B. dlmj "; <br/> sqllist. add (x); <br/> // obtain the cultivated land occupied by construction. <br/> string jszygd = "'watermark', 'watermark', and 'shares '"; <br/> X = "create table jszygd_xp (bsm_1 integer, dlmj double)"; <br/> sqllist. add (x); <br/> X = "insert into jszygd_xp (bsm_1, dlmj) Select bsm_1, sum (tbdlmj_xp) * 0.0001 as dlmj from "+ outregtablename +" where dlmc in ("+ jszygd +") group by bsm_1 "; <br/> sqllist. add (x); <br/> X = "Update" + name_mzzdjsxm + "A inner join"; <br/> X + = "jszygd_xp B "; <br/> X + = "on. BSM = B. bsm_1 set. jszygd = B. dlmj "; <br/> sqllist. add (x); <br/> // ----- <br/> X = "create table zdjsxmdatameasureresult (xmlxdm text (2), xmmc text (100 ), jsxzdm text (2), jsnx text (10), ydzgm double, xzjsyd double, jszygd double, sjcz text (200), MS text (255 ))"; <br/> sqllist. add (x); <br/> X = "insert into zdjsxmdatameasureresult (xmlxdm, xmmc, jsxzdm, jsnx, ydzgm, xzjsyd, jszygd, sjcz, MS )"; <br/> X + = "select xmlxdm, xmmc, jsxzdm, jsnx, sum (ydzgm) as ydzgm, sum (xzjsyd) as xzjsyd, sum (jszygd) as jszygd, sjcz, MS "; <br/> X + =" from "+ name_mzzdjsxm +" "; <br/> X + =" group by xmlxdm, xmmc, jsxzdm, jsnx, sjcz, MS "; <br/> sqllist. add (x); <br/> // execute the SQL statement <br/> for (INT I = 0; I <sqllist. count; I ++) <br/>{< br/> dbwrap. DB. executequery (commandtype. text, sqllist [I]); <br/>}< br/> dbwrap. dispose (); <br/> dbwrap = NULL; 

Update a inner join B on A.2 = B .2 set A.1 = B .1 usage in access

Tables A and B must be entity tables, which actually exist in the Database!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.