mysql ²éѯÎÊÌâ - ÆäËûÊý¾Ý¿â¿ª·¢ / MySQL/Postgresql
ÓÐÈçϼǼ
mysql> select * from user where city='beijing' or skill='pugong';
+------+---------+---------+--------+----------+
| uid | city | company | skill | zhengshu |
+------+---------+---------+--------+----------+
| 1 | beijing | a | baoan | benke |
| 1 | nanjing | b | pugong | benke |
| 2 | shanxi | b | pugong | benke |
+------+---------+---------+--------+----------+
ÎÒÏëµÃµ½ÔÚ±±¾©¹¤×÷¹ýµÄÓÖÓÐpugong¼¼ÄܵÄÈ˵Äuid¡£Ò²¾ÍÊÇuid=1¡£ÕâÑùµÄ²éѯÄܲ»Äܵõ½£¿£¿
»òÕß
SQL code:
select distinct a.uid
from user a inner join user b on a.uid=b.uid
where a.city='beijing' and b.skill='pugong'
Ïà¹ØÎÊ´ð£º
3̨µçÄÔ£¬ÆäÖÐһ̨×÷ΪMYSQL·þÎñÆ÷£¬ÁíÍâ2̨ΪTOMCAT·þÎñÆ÷¡£
MYSQL·þÎñÆ÷ÀïÓÐÒ»Ìõ¼Ç¼£¬ IDΪ10.
ÏÖÔÚ2̨TOMCATͬʱ£¨100%£©·¢ÆðÐÞ¸ÄMYSQLÀïIDΪ10µÄÄÇÌõ¼Ç¼£¬±ÈÈçÐ޸ĴËID¼Ç¼ÀïijһÏîµÄÄÚÈÝ¡£ ±ÈÈçTOMCAT 1Ò ......
Java code:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was51093 seconds ago.The last packet sent successfully to the server was 5 ......
ÔÚÓÃhibernateÏòMysql²åÈë1000ÍòÌõÊý¾Ý ÔÚ²åÈ뽫½üÒ»ÍòÌõÊý¾ÝµÄʱºò
²»¶à²éѯÊý¾Ý¿â·¢ÏÖ²åÈë³É¹¦ ÓÐÊý¾Ý ²»¹ý³ÌÐò³öÏÖ±¨´íÁË
2010-5-23 20:32:53 org.springframework.core.CollectionFactory <c ......