的第n行如何選擇日期的具體數目(讓它成爲第三)的所有客戶ID在例如連續 我有DB看起來像選擇某些關鍵SQL
+---------+------------+------------+------------+-----------+
| OrderID | CustomerID | EmployeeID | OrderDate | ShipperID |
+---------+------------+------------+------------+-----------+
| 10308 | 2 | 7 | 1996-09-18 | 3 |
| 10365 | 3 | 3 | 1996-11-27 | 2 |
| 10355 | 4 | 6 | 1996-11-15 | 1 |
| 10383 | 4 | 8 | 1996-12-16 | 3 |
| 10278 | 5 | 8 | 1996-08-12 | 2 |
| 10280 | 5 | 2 | 1996-08-14 | 1 |
| 10384 | 5 | 3 | 1996-12-16 | 3 |
| 10265 | 7 | 2 | 1996-07-25 | 1 |
| 10297 | 7 | 5 | 1996-09-04 | 2 |
| 10360 | 7 | 4 | 1996-11-22 | 3 |
| 10436 | 7 | 3 | 1997-02-05 | 2 |
+---------+------------+------------+------------+-----------+
,並作爲輸出我們必須得到
╔══╦════════════╦══╦════════════╦══╗
║ ║ CustomerID ║ ║ OrderDate ║ ║
╠══╬════════════╬══╬════════════╬══╣
║ ║ 5 ║ ║ 1996-12-16 ║ ║
║ ║ 7 ║ ║ 1996-11-22 ║ ║
╚══╩════════════╩══╩════════════╩══╝
像這樣
我使用MySQL
你使用哪種RDBMS? – lad2025
嘗試'從customerid =(從表中選擇唯一的customerid)'select select customerid,orderdate' – MaxPD
我使用MySQL,我認爲MySQL的所有命令都能正常工作。 –