Wednesday, October 22, 2014

Upload Excel or CSV straight to MySQL DB an online SAAS

If you have data you would like to import to a database like MySQL there is a simple cloud based tool that allows you to upload your CSV file and create a MySQL script which you can paste into phpMyAdmin or any other tool of your preference. This works for not just CSV but also CSV, TSV, XLSX, XML and JSON files. Similarly, not only for MySQL db but also Postgres and MS SQL

CSV, TSV, XLSX, XML and JSON files

https://sqlizer.io/#/

 Thank you, D4 Software Ltd 483 Green Lanes, London, N13 4BS. for this great tool.

Nested select statement for MySQL db

Here is a example of how to create nested sql statement that indicate with a value is in the list.

SELECT distinct userid from IPSOS where userid in (SELECT distinct otxid from Mag0_20141021) and userid in (SELECT distinct id from Mag1_20141021) and userid in (SELECT distinct id from Mag2_20141021) and userid in (SELECT distinct id from Mag3_20141021) and userid not in (SELECT distinct otxid from problem) 

Notice the where in and where not in and how userid gets compared to the out come of the next select statement