User Tools

Site Tools


Writing /app/www/public/data/meta/toolsandtechnologies/creating_mysql_queries_in_excel.meta failed
toolsandtechnologies:creating_mysql_queries_in_excel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
toolsandtechnologies:creating_mysql_queries_in_excel [2017/05/05 15:50] mmcctoolsandtechnologies:creating_mysql_queries_in_excel [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Creating mySQL Queries in Excel ======
 +
 +Author: Michelle McCausland
 +
 +===== Introduction =====
 +
 +Creating SQL queries in Excel can be a much more efficient way of generating usable queries from a large table of data such as trap knowledge, contact responsibilities, change management managers, EMS widget permissions.
 +
 +===== Implementation =====
 +
 +  * In this example we will be working with the following address detail information that we want to update:
 +
 +{{ :toolsandtechnologies:1.png?nolink |}}
 +
 +  * It looks as though we have all the data we need to generate an update statement.
 +  * Start by clicking on the next blank cell in the column after the first row of data and type an sql statement to work from:
 +
 +{{ :toolsandtechnologies:222.png?nolink |}}
 +
 +  * So now we have an sql statement to populate with data based on each row. Click into this cell with the SQL query and wrap it around '' =" <YOUR SQL QUERY> " ''
 +  * Now you can replace F, G and C with data by typing the following:
 +
 +{{ :toolsandtechnologies:3.png?nolink |}}
 +
 +  * Note this is used to select a cell '' "& <cellreference> &" '' with a number value
 +  * Note this is used to select a cell '' '"& <cellreference> &"' '' with a text value
 +  * So now you have your query and you can copy it down to the other rows by clicking the cell, hovering over the bottom right corner until your mouse icon changes, and then double clicking. (You can also click and drag the handle to copy cells down)
 +
 +{{ :toolsandtechnologies:4.png?nolink |}}
 +
 +  * Now you have all of your queries which dynamically reference cell contents! 
 +  * Be sure to double and triple check these values are correct before running any sql.
 +  * It is a good idea to copy the sql column and "paste values" to only get the sql and not the formula as this may affect running them in the command line.