Hello all,
I have the following table and would like to perform an update on the newacct field. I need to copy the newno value to newacct. But the caveat is that if a group in acct (like rows having 12's, 57's and 66's) in the acct field then the value of the first newno should be the same for...
All,
I posted the above query on the official MySQL forum and received a response on how to work around updating the table being selected. The code is as follows:
UPDATE test SET NewAcct =
NewAcct - (SELECT COUNT(*) FROM (SELECT * FROM test) AS t2 WHERE t2.Acct = test.acct AND t2.NewNo <...
The above query is in microsoft sql server syntax and i need to translate it over to mysql syntax... If I attempt to run this query i get the following error message from mysql engine:
1093 you can't specify target table 'patacct' for update in FROM clause...
Hope this helps...
Thanks,
Dan
I have the following ms sql query but having problems translating it over to mysql:
update t set NewAcct = NewAcct-(select count (*) from t t2 where t2.Acct = t.acct and t2.NewNo < t.NewNo) from t
your help is appreciated.
Thank you,
Dan
Hello folks,
Is it possible to update a column using LOAD DATA INFILE, So the following is an example:
LOAD DATA LOCAL INFILE 'c:/test.txt'
INTO TABLE test
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(lname, fname, zip);
Results:
id | fname | lname | zip
1 | kurt | russell | 45678
2 |...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.