I have two tables with the same column definitions. I need to move (not copy) a row from one table to another. Before I go off and use INSERT INTO/DELETE (in a transaction), is there a smarter way?
SQL Server 2005
...
I'm loading files into a table with php. I create a table like this:
CREATE TABLE IF NOT EXISTS $table (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`order` INT DEFAULT 0,
`data` VARCHAR(200) UNIQUE KEY,
`cur_timestamp` TIMESTAMP DEFAULT NOW())"
And fill it from a text file like this:
LOAD DATA LOCAL
INFILE '".$file ."'
REPLACE INTO TABLE...
Does anybody know what's the maximum number of columns/values you can insert into a table (mysql)? I get an error for... IDK... 20 columns/values? (yes, #_of_col = #no_of_val)
INSERT INTO comenzi (a,b,c,d,e,f,...)
VALUES (1,2,3,4,5,6,...)
...
Hi,
I'm an SQL newbie and trying to figure out how to insert multiple table entries in one SQL statement.
Here is my code:
INSERT INTO [Students](P_Id,FirstName,LastName,class,city,Phone)
SELECT 123,'Avi','Davis',2,'Tel-Mond','03-456789'
UNION
SELECT 234, 'Dani',2,'Dimona',' 02-111'
UNION
SELECT 345,'Itzik',3,'Ariel', '03-2222'
UNION ...
assuming that i have two tables, names and phones
and i want to insert data from some input to the tables, in one query- How can it be done?
Please, if it can be done, explain the syntax.
...
I have a strange problem, I'm sending an SQL query through PHP:
INSERT INTO `lib_plex` (`id`, `active`, `lastUpdated`, `entry_date`, `entry_ip`, `address`, `city`, `state_iso`, `zip_code`, `plex_type`, `price`, `has_garage`, `has_indoor_parking`, `has_outdoor_parking`, `has_pool`, `has_fireplace`, `average_nb_room`, `construction_year`,...