Skip to content

Commit

Permalink
修正資料表沒有 ID 欄位的問題。
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJui committed Mar 7, 2024
1 parent 00e4a21 commit 6a064b0
Show file tree
Hide file tree
Showing 5 changed files with 10,724 additions and 12 deletions.
Binary file modified Kong_Un.db
Binary file not shown.
31 changes: 19 additions & 12 deletions Kong_Un.sqbpro
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><sqlb_project><db path="D:/work/Piau-Im/Kong_Un.db" readonly="0" foreign_keys="1" case_sensitive_like="0" temp_store="0" wal_autocheckpoint="1000" synchronous="2"/><attached/><window><main_tabs open="structure browser pragmas query" current="1"/></window><tab_structure><column_width id="0" width="300"/><column_width id="1" width="0"/><column_width id="2" width="100"/><column_width id="3" width="1880"/><column_width id="4" width="0"/><expanded_item id="0" parent="1"/><expanded_item id="1" parent="1"/><expanded_item id="2" parent="1"/><expanded_item id="3" parent="1"/></tab_structure><tab_browse><current_table name="4,23:mainHan-Ji-Phing-Im-Ji-Tian"/><default_encoding codec=""/><browse_table_settings><table schema="main" name="Han-Ji-Phing-Im-Ji-Tian" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="48"/><column index="2" value="87"/><column index="3" value="40"/><column index="4" value="56"/><column index="5" value="40"/><column index="6" value="40"/><column index="7" value="40"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table><table schema="main" name="Lui_Tsip_Nga_Siok_Thong" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="35"/><column index="2" value="38"/><column index="3" value="36"/><column index="4" value="39"/><column index="5" value="53"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table><table schema="main" name="Sip-Ngoo-Im-Han-Ji-Tian" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="46"/><column index="2" value="43"/><column index="3" value="41"/><column index="4" value="40"/><column index="5" value="38"/><column index="6" value="45"/><column index="7" value="29"/><column index="8" value="82"/><column index="9" value="59"/><column index="10" value="43"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table></browse_table_settings></tab_browse><tab_sql><sql name="Create_Table_for_Sip-Ngoo-Im-Han-Ji-Tian.sql">CREATE TABLE &quot;Sip-Ngoo-Im-Han-Ji-Tian&quot; (
&quot;id&quot; INTEGER,
&quot;han_ji&quot; TEXT,
&quot;tl_im&quot; TEXT,
&quot;freq&quot; REAL,
&quot;siann&quot; TEXT,
&quot;un&quot; TEXT,
&quot;tiau&quot; INTEGER,
&quot;sip_ngoo_im&quot; TEXT,
&quot;siann_bu&quot; TEXT,
&quot;un_bu&quot; TEXT
);</sql><current_tab id="0"/></tab_sql></sqlb_project>
<?xml version="1.0" encoding="UTF-8"?><sqlb_project><db path="D:/work/Piau-Im/Kong_Un.db" readonly="0" foreign_keys="1" case_sensitive_like="0" temp_store="0" wal_autocheckpoint="1000" synchronous="2"/><attached/><window><main_tabs open="structure browser pragmas query" current="3"/></window><tab_structure><column_width id="0" width="300"/><column_width id="1" width="0"/><column_width id="2" width="100"/><column_width id="3" width="1880"/><column_width id="4" width="0"/><expanded_item id="0" parent="1"/><expanded_item id="1" parent="1"/><expanded_item id="2" parent="1"/><expanded_item id="3" parent="1"/></tab_structure><tab_browse><current_table name="4,23:mainHan-Ji-Phing-Im-Ji-Tian"/><default_encoding codec=""/><browse_table_settings><table schema="main" name="Han-Ji-Phing-Im-Ji-Tian" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="48"/><column index="2" value="87"/><column index="3" value="40"/><column index="4" value="56"/><column index="5" value="40"/><column index="6" value="40"/><column index="7" value="40"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table></browse_table_settings></tab_browse><tab_sql><sql name="SQL 1">-- 創建一個新的表格,其結構與原表格相同,但多了一個帶有 AUTOINCREMENT 屬性的 ID 列
CREATE TABLE &quot;Lui_Tsip_Nga_Siok_Thong_new&quot; (
&quot;ID&quot; INTEGER PRIMARY KEY AUTOINCREMENT,
&quot;Ji&quot; TEXT NOT NULL,
&quot;Siann&quot; TEXT NOT NULL,
&quot;Un&quot; TEXT NOT NULL,
&quot;Tiau&quot; TEXT NOT NULL,
&quot;Phing_Im&quot; TEXT NOT NULL
);
-- 將原表格的數據複製到新表格中
INSERT INTO &quot;Lui_Tsip_Nga_Siok_Thong_new&quot; (&quot;Ji&quot;, &quot;Siann&quot;, &quot;Un&quot;, &quot;Tiau&quot;, &quot;Phing_Im&quot;)
SELECT &quot;Ji&quot;, &quot;Siann&quot;, &quot;Un&quot;, &quot;Tiau&quot;, &quot;Phing_Im&quot; FROM &quot;Lui_Tsip_Nga_Siok_Thong&quot;;
-- 刪除原表格
DROP TABLE &quot;Lui_Tsip_Nga_Siok_Thong&quot;;
-- 將新表格重命名為原表格的名稱
ALTER TABLE &quot;Lui_Tsip_Nga_Siok_Thong_new&quot; RENAME TO &quot;Lui_Tsip_Nga_Siok_Thong&quot;;</sql><current_tab id="0"/></tab_sql></sqlb_project>
Expand Down
Loading

0 comments on commit 6a064b0

Please sign in to comment.