출처
설명
텍스트 기반의 웹브라우저입니다.
사용예제
$ lynx http://www.naver.com
- =: 하이퍼링크에서 누르면 현 …
Input:
Visits
+----------+-------------+
| visit_id | customer_id |
+----------+-------------+
| 1 | 23 |
| 2 | 9 |
| 4 | 30 |
| 5 | 54 |
| 6 | 96 |
| 7 | 54 |
| 8 | 54 |
+----------+-------------+
visit_id is the primary key for this table.
This table contains information about the customers who visited the mall.
Transactions
+----------------+----------+--------+
| transaction_id | visit_id | amount |
+----------------+----------+--------+
| 2 | 5 | 310 …
order_number | customer_number |
---|---|
1 | 1 |
2 | 2 |
3 | 3 |
4 | 3 |
-- 1위 한 명만
SELECT o.customer_number
FROM orders o
GROUP BY o.customer_number
ORDER BY COUNT …
MySQL Documentation 13.6.1 BEGIN ... END Compound Statement
[begin_label:] BEGIN
[statement_list]
END [end_label]
MySQL Documentation 13.6.5.1 CASE Statement
CASE case_value
WHEN when_value THEN statement_list
[WHEN when_value THEN statement_list] ...
[ELSE statement_list]
END CASE
Or:
CASE
WHEN search_condition THEN statement_list
[WHEN search_condition THEN statement_list] ...
[ELSE statement_list]
END CASE
Input:
Users table:
+---------+-------+
| user_id | name |
+---------+-------+
| 1 | aLice |
| 2 | bOB |
+---------+-------+
user_id is the primary key for this table.
This table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters.
Output:
+---------+-------+
| user_id | name |
+---------+-------+
| 1 | Alice |
| 2 | Bob …
MySQL Documentation 13.6.6 Cursors