sql
Insert into a MySQL table or update if exists
Use INSERT … ON DUPLICATE KEY UPDATE QUERY:
Convert partially non-numeric text into number in MySQL query
This should work:
SQL version of VLOOKUP
It looks as if you need an outer join, I’ll use a left one in my example: You can also leave out the outer keyword:
Bulk load data conversion error (truncation)
It’s picking up the commas within the comments field as delimiters, because the delimiters are not consistent. The best solution is to insure that all fields are wrapped with double quotes and set FIELDTERMINATOR to ‘”,”‘. Alternately, replace the commas with something unlikely to be in the comments (like ~) and set FIELDTERMINATOR = ‘~’.
Microsoft OLE DB Provider for SQL Server error ‘80004005’
If it is an Express instance, it is most likely not a default instance, but rather a named instance. So you probably meant: Otherwise you’ll need to show us the server properties in SQL Server Configuration Manager on that machine in order for us to be able to tell you how to correct your connection … Read more
ERROR 1148: The used command is not allowed with this MySQL version
You can specify that as an additional option when setting up your client connection: This is because that feature opens a security hole. So you have to enable it in an explicit manner in case you really want to use it. Both client and server should enable the local-file option. Otherwise it doesn’t work.To enable … Read more
How to create a MySQL hierarchical recursive query?
For MySQL 8+: use the recursive with syntax.For MySQL 5.x: use inline variables, path IDs, or self-joins. MySQL 8+ The value specified in parent_id = 19 should be set to the id of the parent you want to select all the descendants of. MySQL 5.x For MySQL versions that do not support Common Table Expressions (up to version 5.7), you would achieve this with the … Read more
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
You didn’t bind all your bindings here You’ve declared a binding called :numRows but you never actually bind anything to it. UPDATE 2019: I keep getting upvotes on this and that reminded me of another suggestion Double quotes are string interpolation in PHP, so if you’re going to use variables in a double quotes string, … Read more
SQL Queries “00904. 00000 – “%s: invalid identifier”
You should try the lower case for the table/column identifiers(like in from/inner join clauses):