我已連接到db.sqlite3在 Windows 上命名的 SQLite 資料庫。運行.tables命令后,我知道我有哪些表,所以我試圖用 顯示其中一個select * from table1,而沒有在 Windows 終端中看到任何輸出。
為什么會這樣?我應該使用一些特殊命令在終端中列印查詢輸出嗎?
uj5u.com熱心網友回復:
我懷疑你的表中有零行。考慮以下空白資料庫中的示例:
-- create a table
sqlite> create table "test"("field1" INTEGER);
-- select rows
sqlite> select * from test;
-- note: no output!
-- insert some values
sqlite> insert into test values(1),(2);
-- try the select again
sqlite> select * from test;
1
2
-- we have output!
-- to check if you have rows, do this:
sqlite> select count(*) from test;
2
-- 2 rows present
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/325074.html
上一篇:不能將null設定為唯一的列
