Excel function using the volume generated sql statement

Original link: https://www.jianshu.com/p/08dde78eb5db

Excel comes with the use of function, you can do a lot of things. Sometimes you do not rush to write code more quickly think of other ways.

A situation encountered in the work, often colleagues sent a excel file, you need to modify the actual data from the data excel table. Figure

640?wx_fmt=other

Points need to be modified to the user D column E column points, just get this demand, if the amount of data a few lines, better said, to write sql queries manually, do comparison. But if the data has reached hundreds of thousands of lines even more, you need to use the tools to excel batch generate sql statement.

step

640?wx_fmt=other

image.png

2, according to the needs, preparation of the implementation of the "" within the sql statement. A plurality of "" quotes & symbolic links may be variable in the table can be entered into the reference A2, representing the data in column A of the second row, i.e., 2019-03-28. Example input = ( "update user set score = " & D2 & "where user_id = '" & B2 & "' and putdate = '" & A2 & "';")

640?wx_fmt=other

3, the same calculation formula affect multiple rows

640?wx_fmt=other

At this point we select sql statement to be executed, copied to the Executive Editor of the database to perform. At this point excel sql script file transfer operation has been completed.

excel is a very powerful tool, built-in formulas and a lot of programming, there are many auxiliary functions can be mastered our work.

640?wx_fmt=png

Guess you like

Origin blog.csdn.net/zhupanlinch/article/details/102693884