亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

MySQL ?? ??? ?? ??

?? ??????? ???? ???? ?? ?? ??? ????.

  1. ????? ????? ??? ???? ?? ???? ?????.

  2. ??? ?? ??? ??? ? ???, ??? ????

  3. ?? ?? ? ???? ?? ??? ??? ? ????.

?? ? ???? ?? ???? ?? ?????.

??? ??? ?????? ?? ??? ???? ?? ???? ?? ???? ??, ?? ??? ?? ??? ??? ??? ?????.

??? ??

?? ???? ??? ???? ?? ?? ??? ??? ???? ?? ??? ? ????. ??? ??? ?? ??? ?? ???? ?????.

  1. ?? ??: ? ???? ??? ?? ??? ???? ?? ??? ?? ???? ???? ??? ??? ?????.

  2. ?? ??: ???? ?? ?? ???? ???? ?? ?? ??? ?? ??? ???? ?????.

?? ??? ?? ??? ?? ? ?? ????? ??? ???? ??????.

  1. ??? ??? ???? User ???
  2. ?? ???? ?? ??? ????? ???? Order ???

user ??? ???

???? ?? ?? ??? ?? user (user (
   uid int(11) NOT NULL,
   username varchar(30) NOT NULL,
   password char(32) NOT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS order_goods (
   oid int(11) NOT NULL,
   uid int(11) NOT NULL,
   name varchar(50) NOT NULL,
   buytime uid int(11) NOT NULL,
username varchar(30) NOT NULL,

password char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

???? ?? ?? ??? ?? order_goods (oid int(11) NOT NULL,uid int(11) NOT NULL,?? varchar(50) NOT NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8;uidusernamepassword1Jingtian 1 234562 ????2456673????12355314???1234555 ???5abcwa6 ????abcdeef 7anglebabycaption8TFBOYSabcdwww9An Xiao chao12tfdd wd10Gao Xiaofeng13????121rcfwr fq14????123123tcsd15 ????3cxvdfs

order_goods ???? ??? ????:

?? ?? int(11) NOT NULL??? ??? ???? ??? ????:
??
5?? order_goods ????? uid? ??? ???? uid ??? ?????. ? ??? oid? ?? ??? ?? 1?? uid? ?? ???? 10???. ??? ???? uid 10? ?? ???? ??: Gao Xiaofeng. ???? Apple ???? ??????. ?? ?? buytime? ??? ????????. ?? ??category??? ???? ??? 1? ?????. ?? [??], ? n? ? 1 [??]?? ??? ?????. ], ??? n ??? ??
oiduidnamebuytime
110Apple mouse121 2313
23??? ?? 4242123
3??? ???12123413
??:
?? ?? 1:

?

user.uid,user.username? ??? ??,order_goods.oid,order_goods.uid,order_goods.name?? user,order_goods?? ??, ??? user.uid = order_goods.uid ;

?? ???? ????? ?? ???? ??? ????? ???? ??? ??? ?????

??: ?? ??? from ???? ??? ??? ?????.

??? ??? ?? ??? ??? ??? ???? ????. ??? ?? ???? ???? ?? ?? ??? ? ????. ??? ??? ??? ?? ?? string.field? ?????.

mysql> ??? u,order_goods o?? ??? ???? u.uid,u.username, o.oid,o.uid,o.name? ?????. ??? u.uid = o.uid;
+------+------------+------+------+---------------+
| ??? | ??? | +------+------------+------+------+---------------+
10 | ????? | 10 | 3 | ???? 2 | 12 | ????? 12 | 15 | 3 | ? ??? | 3 | +------+------------+------+------+---------------+
5? ??(0.00?)


?? ?? 2:


category

??? ??
??? 1. ?? [??], ??? n ?? ?? ? 1 ??? ?? INNER JOIN ??? n;

<blockquote id="satou"><ul id="satou"><kbd id="satou"></kbd></ul></blockquote>
?? ??
Exampleuser.uid,user.username? ??? ???? ??,order_goods.oid,order_goods.uid,order_goods.name? ??? ?? ???? shopname?? user.uid? order_goods = order_goods.uid;
?? ???? ????? ?? ???? ??? ????? ???? ??? ??? ?????

??? ???? 1? ?????.

mysql> ??? ?? ?? order_goods?? ??? ???? user.uid,user.username, order_goods.oid,order_goods.uid,order_goods.name? ?? ???? ?? = order_goods.uid;
+------+------------+------+------+---------------+
| ??? | ??? | +------+------------+------+------+---------------+
10 | ????? | 10 | 3 | ???? 2 | 12 | ????? 12 | 15 | 3 | ???? 5 |
+------+------------+------+------+---------------+
5? ??(0.00?) ?? ?? JOIN ??? n on ??;



Example

select * from user left Join order_goods on user.uid = order_goods.uid;

?? ?? ?? on the ??, ??? ???? ?? ???? ???? ??? ??? ?????

?? ??? ?? ??? ??? ??? ???? ???? ??? ??? ????.

?? ??: ??? ???? ???? ???? ?? ???? ???? ?? ???? ?? ???? ?????.

mysql> select * from user left Join order_goods on user.uid = order_goods.uid;
+-- - --+------------+---+------+------+---- --- -------+----------+
| ??? ?? | oid ?? |
+----+- --- ----+------------+------+------+------------- --+ -----------+
| 10 | ?? ??? | 1235531 | 3121241 |
| 12 | 3cxvdfs | 1235531 |5 |??? ??? 123456 | NULL | NULL | NULL | |
| 5abcwa | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | | NULL | NULL ----------+------+------+---------------+---- ---- --+
16? ??(0.00?)

??? ??: ??? ???? ???? ?? ???? ???? ??? ???? ?? ???? ?????

Category??? ??
?? ??? 1? ?????. ?? [????], ??? n. ??? 1? ?? ??? JOIN ??? n ??;
Exampleselect * from user right Join order_goods on user.uid = order_goods.uid;
?? ?? ?? ???? ?? ???? ??? ????? ???? ??? ??? ?????

mysql> ??? ???? *? ???? user.uid?? order_goods? ?? = order_goods.uid;
+------+- - ---------+------------+------+------+---------------+ - ----------+
| ??? ?? | oid | ?? ?? |
+-------+- ------+------+------+---------------+------------+
| 10 | 3124qwqw | ?? ??? | 1235531 | 12 | 3 | 12 | 15 | 3cxvdfs | 3424212 | 121234 13 | --- ------+------------+------+------+---------------+---- -- ----+
5? ?(0.00?)

Subquery

??? ??? ? ??? ??? ?? select ?? ??? ?? ?? ??? ???? ???. ?? ??? ???? ????? in, not in, =, !=, ???, ???? ?? ?? ?????.

Category

??? ???? ??select field from table where field in (condition)? 1select * from user where uid in (1, 3 , 4);?? 1 ??ID? ??? ??? ???? 2select * from user where uid in(order_goods?? uid ??);?? 2 ?? ?? ??? ??? ??? ??? ?????

? 1:

mysql> uid? (1,3,4);
? ????? *? ?????. +------+------------+----------+
| ??? ?? |
+------+------------+----------+
1 | ??? | 3 |???? | 4 | ??? 123455 |
+------+------------+----------+
3? ??(0.00?)

? 2:

mysql> select * from user where uid in(order_goods?? uid ??);
+------+------------+----------+

| ??? ?? |
+------+------------+----------+
10 | ????? | 3 |???? | 12 | ? ???? |
15 | ???? | +------+------------+----------+
4 ? ??(0.00?)


mysql> select * from emp where deptno in(dept?? deptno ??);

Union ??

Union ? Union All ???? ???? ? ???? ???? ?????. a ?? ?? ??? ??? ? ??? ???? ?? ?????. ?? ?? ???? ??? ?? ????? ???, ???? ?? ?? ? ??? ?? ??? ??? ???? ??? ???? ??? ?????.

Category

??? ???? ??select ? 1 Union[all] select ? 2Exampleselect * from user where uid in (1, 3, 4 );?? ??? ???? ??? ??? ??? ???? ??? ??? ?????mysql> ??? ???? uid ?? order_goods?? uid ??; +------+ |
+------+
1 |

2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
+------+
15? ?? (0.00?)


???? ??

||
<?php echo "Hello Mysql"; ?>
            • <strong id="satou"></strong>
              <thead id="satou"></thead>