[SQL]select h.history_id as historyId,h.isbn as isbn,status, borrow_date as borrowDate,return_date as returnDate from hisotry h left join book b on h.isbn = b.isbn [Err] 1146 - Table 'book.hisotry' doesn't exist
时间: 2024-02-29 13:51:04 浏览: 138
qwebhistory.rar_The History
错误提示显示 `hisotry` 表不存在,可能是表名拼写错误导致的。请检查表名拼写是否正确,应该为 `history`。
正确的 SQL 语句如下:
```sql
SELECT h.history_id AS historyId, h.isbn AS isbn, status, borrow_date AS borrowDate, return_date AS returnDate
FROM history h
LEFT JOIN book b ON h.isbn = b.isbn
```
这个查询语句将历史记录表 `history` 和图书表 `book` 进行左外连接,并返回历史记录ID(historyId)、图书ISBN(isbn)、状态(status)、借出日期(borrowDate)和归还日期(returnDate)这些列的信息。
阅读全文