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'
Ïà¹ØÎÊ´ð£º
ÇëÎÊÏÂÄܲ»ÄÜÔÙwindows϶¨ÆÚÇå¿ÕmysqlÒ»¸ö±íÖеÄÈ«²¿Êý¾Ý£¬ÓÃPHPʵÏÖ£¡
лл¸÷λÁË
¾Í±ÈÈçÒ»¸öÐÇÆÚÇå¿ÕÒ»´Î
±ÈÈçÿ¸öÐÇÆÚÁùÁãµãÇå¿ÕÒ»´Î£¡
ллÁË
¼Æ»®ÈÎÎñ...php....sql...truncate....OK
Äã¾ÍÕâ½ÓÔÚҳà ......
ÎÒÓõÄÊÇÁ¬½Ó³Ø×öµÄ£¬ÅäÁ¬½Ó³ØµÄ·½·¨Ó¦¸ÃûÓÐ´í£¬ÎªÊ²¾ÍÊdzöÏÖÕâÖÖÎÊÌâ
javax.servlet.ServletException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/test
ÇëÎÊ´óÏÀÃÇÕâÊÇÔ ......
3̨µçÄÔ£¬ÆäÖÐһ̨×÷ΪMYSQL·þÎñÆ÷£¬ÁíÍâ2̨ΪTOMCAT·þÎñÆ÷¡£
MYSQL·þÎñÆ÷ÀïÓÐÒ»Ìõ¼Ç¼£¬ IDΪ10.
ÏÖÔÚ2̨TOMCATͬʱ£¨100%£©·¢ÆðÐÞ¸ÄMYSQLÀïIDΪ10µÄÄÇÌõ¼Ç¼£¬±ÈÈçÐ޸ĴËID¼Ç¼ÀïijһÏîµÄÄÚÈÝ¡£ ±ÈÈçTOMCAT 1Ò ......
ÎÒ¾õµÃmysqlºÍsqlserverÓй²Í¬µÄµØ·½£º
ÓиöÎÊÌâÊǹØÓÚ±íµÄËøÎÊÌ⣺
½ø³ÌA ½ø³ÌB
select * from user where id in lock share mode£¨¹²ÏíËø)
&nb ......