• twitter 2.png
  • facebook 2.png
  • email 2.png

Alamise-Blog

Le blog du technicien
  • 主页 | Frontpage
  • 文章目录 | Category
  • 搜索 | Search
slider3
slider2
slider1
slider4
slider5
slider6
Home
  • FREENAS (3)
  • 主机 (17)
  • Windosw Server 2008 (18)
  • Windows 7 (18)
  • NAS (1)
  • Firefox (4)
  • 路由 (1)
  • 按键精灵 (2)
  • vmware (2)
  • Debian (18)
  • Artisan (1)
  • CentOS (20)
  • Acdsee (1)
  • OSx86 (3)
  • Oracle (4)
  • VPS (3)
  • Gallery 3 (1)
  • Teamspeak (1)
  • VPN (18)
  • ADbloc PLUS (1)
  • 卡巴斯基 (1)
  • Chrome (1)
  • PAP2T (3)
  • MYSQL (8)
  • zend server (1)

LOG IN

Forgot your password?

Forgot your username?

MYSQL

left join

SELECT `tbl_cours_info`.crs_nom as cours,
 concat(`tbl_professeur`.`prof_nom`," ",`tbl_professeur`.`prof_prenom`)as prof,
 `tbl_emploi_du_temps`.`empl_jours` as jours,
 `tbl_emploi_du_temps`.`empl_heures_begin` as tbegin,
 `tbl_emploi_du_temps`.`empl_heures_end` as tend
FROM `tbl_emploi_du_temps`
LEFT JOIN `tbl_cours_info` ON `tbl_emploi_du_temps`.`empl_cours_id` = `tbl_cours_info`.`crs_id`
LEFT JOIN `tbl_professeur` ON `tbl_emploi_du_temps`.`empl_prof_id`= `tbl_professeur`.`prof_id`
ORDER BY `tbl_emploi_du_temps`.`empl_jours` ASC

 

code citation sql

{-codecitation class="brush:sql" width="500px"} {-/codecitation}

 

mysql add foreign key 外键

 -- -------------------------------------------------------------------------------------------
ALTER TALBE tbl_choix_examen
ADD PRIMARY KEY (choix_examen_id);
-- -------------------------------------------------------------------------------------------
ALTER TABLE `tbl_choix_examen` ADD PRIMARY KEY ( `choix_examen_id` ) 
-- -------------------------------------------------------------------------------------------
ALTER TABLE `ilci`.`tbl_choix_examen` ADD PRIMARY KEY ( `choix_examen_id` ) 
ALTER TABLE `tbl_choix_examen` CHANGE `choix_examen_id` `choix_examen_id` INT( 10 ) NOT NULL AUTO_INCREMENT 
-- -------------------------------------------------------------------------------------------
ALTER `ilci`.`tbl_choix_examen`
 ADD [CONSTRAINT [symbol]] FOREIGN KEY
 [index_name] (index_col_name, ...)
 REFERENCES tbl_name (index_col_name,...)
 [ON DELETE reference_option]
 [ON UPDATE reference_option]
-- -------------------------------------------------------------------------------------------
alter table `ilci`.`tbl_choix_examen` add foreign key(choix_examen_stu_id) references tbl_student(stu_id);
-- -------------------------------------------------------------------------------------------
alter table `ilci`.`tbl_choix_examen` add foreign key(choix_examen_emploi_id) references tbl_emploi_du_temps(empl_id);
-- -------------------------------------------------------------------------------------------
alter table `ilci`.`tbl_choix_examen_temps` add foreign key(emploi_du_temps_id) references tbl_emploi_du_temps(empl_id);
-- -------------------------------------------------------------------------------------------
 

 

   

Page 2 of 2

  • Start
  • Prev
  • 1
  • 2
  • Next
  • End
© 2011 Alamise.com. All Rights Reserved. Réaliser par Lidesign.fr