خرید بک لینک

Vote count: 0

I have got such table:

mysql> show create table finalG;
*************************** 1. row ***************************
       Table: final
Create Table: CREATE TABLE `final` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `cdatetime` varchar(255) NOT NULL,
  `address` varchar(255) NOT NULL,
  `district` varchar(255) NOT NULL,
  `beat` varchar(255) NOT NULL,
  `grid` varchar(255) NOT NULL,
  `crimedescr` varchar(255) NOT NULL,
  `ucr_ncic_code` varchar(255) NOT NULL,
  `latitude` varchar(255) NOT NULL,
  `longitude` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=IoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

And I have got csv file which looks like this:

cdatetime,address,district,beat,grid,crimedescr,ucr_ncic_code,latitude,longitude
1/1/06 0:00,3108 OCCIDENTAL DR,3,3C        ,1115,10851(A)VC TAKE VEH W/O OWNER,2404,38.55042047,-121.3914158
1/1/06 0:00,2082 EXPEDITION WAY,5,5A        ,1512,459 PC  BURGLARY RESIDENCE,2204,38.47350069,-121.4901858
1/1/06 0:00,4 PALEN CT,2,2A        ,212,10851(A)VC TAKE VEH W/O OWNER,2404,38.65784584,-121.4621009
1/1/06 0:00,22 BECKFORD CT,6,6C        ,1443,476 PC PASS FICTICIOUS CHECK,2501,38.50677377,-121.4269508

What I want to do is load that CSV file into table final. Problem is that csv file doesn't have ID column so I'm thinking is it possible to somehow tell mysql to skip column ID and load data into the rest columns, but ID be used. So ideally it would look like this:

"1/1/06 0:00,3108 OCCIDENTAL DR,3,3C ,1115,10851(A)VC TAKE VEH W/O OWNER,2404,38.55042047,-121.3914158" gets loaded into columns and mysql automatically assign this record to 1, then "1/1/06 0:00,2082 EXPEDITION WAY,5,5A ,1512,459 PC BURGLARY RESIDENCE,2204,38.47350069,-121.4901858" gets loaded and mysql assign this row to 2 etc etc..

How I can do that ? Maybe there is better way for that ?

Thanks

asked 45 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 13 تير 1395 ساعت: 18:54

صفحه بندی