359 reputation
29
bio website reynierpm.com
location Caracas, Venezuela
age 30
visits member for 2 years
seen Mar 19 at 15:47

Mar
19
accepted Generate INSERT statement from SELECT query
Mar
19
comment Generate INSERT statement from SELECT query
I modified a bit the query and now looks like INSERT INTO courrier_city (country, state, created, modified) SELECT "VE", IF(id_estado<10, CONCAT("VE.0", id_estado),CONCAT("VE.", id_estado)), NOW(), NOW() FROM zoom_city but I get this error any time I try to run it [Err] 1062 - Duplicate entry 'VE-VE.01-' for key 'PRIMARY' why is that?
Mar
18
asked Generate INSERT statement from SELECT query
Feb
27
comment Error 1005: Can't create table can't find where the problem is
@ypercube add the CHARACTER SET and COLLATE in all tables fix the problem, thanks all of yours
Feb
27
accepted Error 1005: Can't create table can't find where the problem is
Feb
27
revised Error 1005: Can't create table can't find where the problem is
added 1065 characters in body
Feb
27
asked Error 1005: Can't create table can't find where the problem is
Feb
27
comment Execute SQL query after execute TRUNCATE in a table
@Up_One I want to run first TRUNCATE and after the SQL sentence
Feb
27
asked Execute SQL query after execute TRUNCATE in a table
Apr
24
awarded  Notable Question
Apr
17
awarded  Yearling
Mar
21
comment Database and query optimizacion
You're right I accept the answer and made modifications later to suit what I need
Mar
21
accepted Database and query optimizacion
Mar
21
comment Database and query optimizacion
If not then insert in tbl_ndatabase, is that what your procedure and trigger does? Do I need to index or make unique the field numbers in each table in order to not repeat them?
Mar
21
comment Database and query optimizacion
Hi @gord-thompson, I try to get how PROCEDURE and TRIGGER works but can't get the logic behind them. Also I added a test data file (first post edited) for testing purpose with the three tables I mention before. Maybe you don't understand the problem or maybe I don't understand the procedure. As I said in first post I have three identical tables: tbl_blacklist, tbl_cmdatabase and tbl_database, then I get some data from a Excel file grammatically. What I need to do is for each data in Excel check if exists in tbl_blacklist or in tbl_cmdatabase, if exists then go to the next Excel record
Mar
21
revised Database and query optimizacion
added 117 characters in body
Mar
20
comment Database and query optimizacion
@FrustratedWithFormsDesigner I'm not a store procedure expert also not a MySQL expert so I'll need some help on this
Mar
20
comment Database and query optimizacion
Any way to use this answer to insert values without PHP intervention? If a return a count(*) then I will need to check trough PHP and then make the insert but I would like to know if any of the sentences on the post I leave could be used
Mar
20
comment Database and query optimizacion
@ypercube I check if number exists trough PHP, reading all the rows of each table and then comparing but this is veryyyyyyyy slowly and I'm trying to find a solution based on MySQL or any way to optimizing the queries or the design and I leave the SELECT statement because I need to list the records based on a number that users enter in my application that should be between 500 and 3000
Mar
20
comment Database and query optimizacion
Just a SELECT * FROM tbl_database LIMIT 3000, 6000 and this is the result > Showing rows 3000 - 8999 ( 6,000 total, Query took 0.0080 sec) what is query plan? I didn't know that