我有3个表,我想在编写此代码时将这3个表加入1。
选择* 来自bol_rows 加入司机 在drivers.id = bol_rows.idd上
现在,我想将bol_rows和drivers表与receive_of_payments结合在一起,并为此使用一个新名称。但是不知道如何,有人可以帮我吗?
创建表bol_rows( idd int(25)UNSIGNED NOT NULL, cargo_identity varchar(190)收集utf8mb4_unicode_ci NOT NULL, id bigint(20)UNSIGNED NOT NULL, column1 varchar(191)收集utf8mb4_unicode_ci默认值为NULL, 主键(idd) )ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
将INSERT INTO插入bol_rows(idd,cargo_identity,id,column1)值 (1,'Sirjan',671569,'97 / 38'), (2,'Sirjan',671568,'97 / 38'), (3,'Sirjan',671563,'97 / 38'), (4,'Azadegan',598023,'97 / 37'), (5,'Azadegan',598024,'97 / 37'), (6,'Azadegan',598025,'97 / 37'), (7,'Azadegan',598027,'97 / 37'), (8,'Sirjan',809430,'97 / 37'), (9,'Sirjan',809431,'97 / 37'), (10,'Sirjan',809437,'97 / 37'), (11,'Sirjan',809378,'97 / 37'), (12,'Azadegan',419498,'97 / 36'), (13,'Azadegan',419499,'97 / 36'), (14,'Azadegan',419500,'97 / 36'), (15,'Azadegan',598001,'97 / 37'), (16,'Azadegan',598003,'97 / 37'), (17,'Sirjan',435725,'97 / 36'), (18,'Sirjan',914614,'97 / 31'), (19,'Sirjan',914670,'97 / 31'), (20,'Azadegan',419487,'97 / 36'), (21,'Sangan',262867,'97 / 35');
创建表drivers
(
id int(22)UNSIGNED NOT NULL,
名称varchar(191)COLLATE utf8mb4_unicode_ci NOT NULL,
family_name varchar(191)COLLUT utf8mb4_unicode_ci NOT NULL,
national_code varchar(10)收集utf8mb4_unicode_ci NOT NULL,
主键(id)
)ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
INSERt INTO驱动程序(ID,名称,家庭名称,国家代码)VALUES (1,“ Rahman”,“ Tasooji”,2280604337), (2,'Abdolrahim','Makari',07487770756), (3,'Mohammad','Jazini',1141855224), (4,'Alireza','Soheilinia',0889652215), (5,'Mohammad','Mohebbinia',6509812223), (6,'Mohammad','Tahani',5039478356), (7,'Hassan','Tahani',5039769911), (8,'Mahdi','Moallem',0859557911), (9,'Mohammad','Malekik',3760196675), (10,'Fateh','Rostamnejad',3762401403), (11,'Hamid','Raoofnejad',2301587754), (12,'Noorollah','Tajik',0769170870), (13,'侯赛因','Kazemian',5629919172), (14,'Mohammad','Rahmatizadeh',6509841495), (15,'Rahmattollah','Behrooz',0769639879), (16,'Ramezan','Mohammadi',0859513734), (17,'Rahmat','Khajavi',5629819172), (18,'Hassan','Shaghab',0889404313), (19,'Javad','Mahmoodabaadi',3178855858), (20,'Hassan','Taheri',0859585301), (21,'Hojjat','Abazarnejad',2993886576), (22,'Mansour','Gorgani',4979701612);
创建表格付款收据( id int(22)UNSIGNED NOT NULL, 卡VARCHAR(191)收集utf8mb4_unicode_ci NOT NULL, 数量varchar(191)COLLUT utf8mb4_unicode_ci NOT NULL ); INSERT INTO receive_of_paymentS(身份证,卡,金额)VALUES (1,6362144270562676,26305800), (2,6362144270585123,27805200), (3,6362144270596138,25367400), (4,6362144270507986,27417600), (5,6362144270571198,24174000), (6,61621442270506525,28702800), (7,6362144270562643,26520000), (8,6362144270521052,28723200), (9,6362144270562585,26040600), (10,6362144270562577,26418000), (11,6362144270562569,26693400), (12,6362144270514420,27070800), (13,6362144270551729,24571800), (14,6362144270516649,27713400), (15,6362144270507358,28855800), (16,6362144270506558,29284200), (17,6362144270551729,26683200), (18,6362144270521029,28815000), (19,6362144270562593,26856600), (20,6362144270529634,27030000), (21,6362144270562601,25163400), (22,6362144270592731,40851600);