November 2024

left join

  • Published in MYSQL
  • December 27, 2011

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

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

{/codecitation}

Read more...

mysql add foreign key 外键

  • Published in MYSQL
  • December 27, 2011

{codecitation class="brush:sql" width="500px"}
-- -------------------------------------------------------------------------------------------
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);
-- -------------------------------------------------------------------------------------------
{/codecitation}

 

Read more...

win7删除OEM隐藏分区 Diskpart.exe

  • Published in Windows 7
  • December 16, 2011

windows自带的这个工具叫Diskpart.exe,具体方法:

1. win+r 键 打开运行程序,输入diskpart.exe 回车

2. 扫描硬盘 输入 rescan

3:输入“list disk”敲回车,用来显示磁盘列表

4:输入“select disk 磁盘号”(例“selectdisk 0”) 敲回车,选择隐藏分区所在的磁盘。//一定要选择,即使是当前盘

5:输入“list partition”命令,敲回车,显示所选择磁盘的分区

6: 输入“select partition 分区号 ”(例select partition 2)敲回车,选择隐藏分区分区号。

7:输入“delete partition override "删除隐藏分区.

Read more...

enable wireless in Windows Server 2008

if you've just installed Windows Server 2008, and are trying to get connected to the internet via wireless you'll have no end of problems as it just will not see any wireless networks no matter what driver you install for your wireless card.

The reason is because Wireless is disabled by default in Windows Server 2008.

To resolve it, do as follows

in Server manager scroll down to Features Summary and click on Add Features.

Read more...

mysql mycnf 4g centos 5.7 plesk sb panel

  • Published in CentOS 5
  • November 30, 2011

[mysqld]
bind-address=127.0.0.1
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

 

Read more...
Subscribe to this RSS feed
Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 18

Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

Notice: Undefined offset: 2 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

Notice: Undefined offset: 3 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 18

Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

Notice: Undefined offset: 2 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

Notice: Undefined offset: 3 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34