{"id":1047550,"date":"2024-12-31T13:43:28","date_gmt":"2024-12-31T05:43:28","guid":{"rendered":""},"modified":"2024-12-31T13:43:36","modified_gmt":"2024-12-31T05:43:36","slug":"python%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e5%88%97%e5%90%8d","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1047550.html","title":{"rendered":"python\u5982\u4f55\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/34d1a82e-2ba4-43be-8f0a-405926d48ea5.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d<\/strong>\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u53d6\u51b3\u4e8e\u4f60\u4f7f\u7528\u7684\u6570\u636e\u5e93\u548c\u76f8\u5e94\u7684\u5e93\u3002\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528SQLite3\u3001PyMySQL\u3001Psycopg2\u3001SQLAlchemy\u7b49\u5e93\u6765\u8fde\u63a5\u6570\u636e\u5e93\u5e76\u83b7\u53d6\u5217\u540d\u3002<strong>\u4f7f\u7528SQLite3\u3001\u4f7f\u7528PyMySQL\u3001\u4f7f\u7528Psycopg2\u3001\u4f7f\u7528SQLAlchemy<\/strong>\u3002\u63a5\u4e0b\u6765\u8be6\u7ec6\u63cf\u8ff0\u4f7f\u7528SQLite3\u83b7\u53d6\u6570\u636e\u5e93\u5217\u540d\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528SQLite3<\/h3>\n<\/p>\n<p><p>SQLite3\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u9002\u7528\u4e8e\u8f7b\u91cf\u7ea7\u6570\u636e\u5e93\u64cd\u4f5c\u3002\u8981\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5bfc\u5165sqlite3\u5e93\u3002<\/li>\n<li>\u8fde\u63a5\u5230SQLite\u6570\u636e\u5e93\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u6e38\u6807\u5bf9\u8c61\u3002<\/li>\n<li>\u6267\u884c\u67e5\u8be2\u5e76\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import sqlite3<\/p>\n<h2><strong>\u8fde\u63a5\u5230SQLite\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = sqlite3.connect(&#39;example.db&#39;)<\/p>\n<p>cursor = conn.cursor()<\/p>\n<h2><strong>\u6267\u884c\u67e5\u8be2<\/strong><\/h2>\n<p>cursor.execute(&#39;SELECT * FROM table_name&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u5217\u540d<\/strong><\/h2>\n<p>column_names = [description[0] for description in cursor.description]<\/p>\n<p>print(column_names)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528PyMySQL<\/h3>\n<\/p>\n<p><p>PyMySQL\u662f\u4e00\u4e2a\u7528\u4e8e\u8fde\u63a5MySQL\u6570\u636e\u5e93\u7684\u7eafPython\u5e93\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyMySQL\u83b7\u53d6\u6570\u636e\u5e93\u5217\u540d\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5PyMySQL\u5e93\u3002<\/li>\n<li>\u5bfc\u5165PyMySQL\u5e93\u3002<\/li>\n<li>\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u6e38\u6807\u5bf9\u8c61\u3002<\/li>\n<li>\u6267\u884c\u67e5\u8be2\u5e76\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pymysql<\/p>\n<h2><strong>\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = pymysql.connect(host=&#39;localhost&#39;, user=&#39;user&#39;, password=&#39;password&#39;, db=&#39;database&#39;)<\/p>\n<p>cursor = conn.cursor()<\/p>\n<h2><strong>\u6267\u884c\u67e5\u8be2<\/strong><\/h2>\n<p>cursor.execute(&#39;SELECT * FROM table_name&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u5217\u540d<\/strong><\/h2>\n<p>column_names = [description[0] for description in cursor.description]<\/p>\n<p>print(column_names)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528Psycopg2<\/h3>\n<\/p>\n<p><p>Psycopg2\u662f\u4e00\u4e2a\u7528\u4e8e\u8fde\u63a5PostgreSQL\u6570\u636e\u5e93\u7684\u5e93\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Psycopg2\u83b7\u53d6\u6570\u636e\u5e93\u5217\u540d\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Psycopg2\u5e93\u3002<\/li>\n<li>\u5bfc\u5165Psycopg2\u5e93\u3002<\/li>\n<li>\u8fde\u63a5\u5230PostgreSQL\u6570\u636e\u5e93\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u6e38\u6807\u5bf9\u8c61\u3002<\/li>\n<li>\u6267\u884c\u67e5\u8be2\u5e76\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import psycopg2<\/p>\n<h2><strong>\u8fde\u63a5\u5230PostgreSQL\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = psycopg2.connect(host=&#39;localhost&#39;, database=&#39;database&#39;, user=&#39;user&#39;, password=&#39;password&#39;)<\/p>\n<p>cursor = conn.cursor()<\/p>\n<h2><strong>\u6267\u884c\u67e5\u8be2<\/strong><\/h2>\n<p>cursor.execute(&#39;SELECT * FROM table_name&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u5217\u540d<\/strong><\/h2>\n<p>column_names = [description[0] for description in cursor.description]<\/p>\n<p>print(column_names)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528SQLAlchemy<\/h3>\n<\/p>\n<p><p>SQLAlchemy\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684SQL\u5de5\u5177\u5305\u548c\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\u5668\uff08ORM\uff09\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528SQLAlchemy\u83b7\u53d6\u6570\u636e\u5e93\u5217\u540d\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5SQLAlchemy\u5e93\u3002<\/li>\n<li>\u5bfc\u5165SQLAlchemy\u5e93\u3002<\/li>\n<li>\u521b\u5efa\u6570\u636e\u5e93\u8fde\u63a5\u3002<\/li>\n<li>\u53cd\u5c04\u8868\u7ed3\u6784\u5e76\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from sqlalchemy import create_engine, MetaData, Table<\/p>\n<h2><strong>\u521b\u5efa\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/h2>\n<p>engine = create_engine(&#39;sqlite:\/\/\/example.db&#39;)<\/p>\n<p>metadata = MetaData(bind=engine)<\/p>\n<h2><strong>\u53cd\u5c04\u8868\u7ed3\u6784<\/strong><\/h2>\n<p>table = Table(&#39;table_name&#39;, metadata, autoload=True)<\/p>\n<h2><strong>\u83b7\u53d6\u5217\u540d<\/strong><\/h2>\n<p>column_names = [column.name for column in table.columns]<\/p>\n<p>print(column_names)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u8be6\u7ec6\u63cf\u8ff0\uff1a\u4f7f\u7528SQLite3\u83b7\u53d6\u6570\u636e\u5e93\u5217\u540d<\/h3>\n<\/p>\n<p><p>SQLite3\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5b83\u7684\u6570\u636e\u5e93\u662f\u4e00\u4e2a\u5355\u4e00\u7684\u666e\u901a\u78c1\u76d8\u6587\u4ef6\u3002SQLite3\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528SQLite3\u83b7\u53d6\u6570\u636e\u5e93\u5217\u540d\u7684\u8be6\u7ec6\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165sqlite3\u5e93<\/strong>\uff1a\u9996\u5148\uff0c\u4f60\u9700\u8981\u5bfc\u5165sqlite3\u5e93\uff0c\u8fd9\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u7528\u4e8e\u4e0eSQLite\u6570\u636e\u5e93\u4ea4\u4e92\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import sqlite3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8fde\u63a5\u5230SQLite\u6570\u636e\u5e93<\/strong>\uff1a\u4f7f\u7528<code>sqlite3.connect()<\/code>\u65b9\u6cd5\u8fde\u63a5\u5230SQLite\u6570\u636e\u5e93\u3002\u5982\u679c\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5b83\u5c06\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">conn = sqlite3.connect(&#39;example.db&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u521b\u5efa\u4e00\u4e2a\u6e38\u6807\u5bf9\u8c61<\/strong>\uff1a\u4f7f\u7528<code>conn.cursor()<\/code>\u65b9\u6cd5\u521b\u5efa\u4e00\u4e2a\u6e38\u6807\u5bf9\u8c61\u3002\u6e38\u6807\u7528\u4e8e\u6267\u884cSQL\u67e5\u8be2\u548c\u83b7\u53d6\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">cursor = conn.cursor()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u6267\u884c\u67e5\u8be2<\/strong>\uff1a\u4f7f\u7528<code>cursor.execute()<\/code>\u65b9\u6cd5\u6267\u884c\u4e00\u4e2aSQL\u67e5\u8be2\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u6267\u884c\u4e00\u4e2a\u7b80\u5355\u7684<code>SELECT<\/code>\u67e5\u8be2\u6765\u83b7\u53d6\u6240\u6709\u5217\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">cursor.execute(&#39;SELECT * FROM table_name&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li><strong>\u83b7\u53d6\u5217\u540d<\/strong>\uff1a\u4f7f\u7528\u6e38\u6807\u5bf9\u8c61\u7684<code>description<\/code>\u5c5e\u6027\u83b7\u53d6\u5217\u540d\u3002<code>description<\/code>\u5c5e\u6027\u662f\u4e00\u4e2a\u5305\u542b\u6bcf\u5217\u63cf\u8ff0\u4fe1\u606f\u7684\u5143\u7ec4\u5217\u8868\u3002\u6bcf\u4e2a\u63cf\u8ff0\u4fe1\u606f\u5143\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u662f\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">column_names = [description[0] for description in cursor.description]<\/p>\n<p>print(column_names)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"6\">\n<li><strong>\u5173\u95ed\u8fde\u63a5<\/strong>\uff1a\u64cd\u4f5c\u5b8c\u6210\u540e\uff0c\u5173\u95ed\u6570\u636e\u5e93\u8fde\u63a5\u4ee5\u91ca\u653e\u8d44\u6e90\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5176\u4ed6\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u4e00\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u7528\u6765\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528Pandas\u5e93<\/strong>\uff1aPandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u548c\u6570\u636e\u64cd\u4f5c\u5e93\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Pandas\u7684<code>read_sql_query<\/code>\u65b9\u6cd5\u6765\u8bfb\u53d6SQL\u67e5\u8be2\u7ed3\u679c\uff0c\u5e76\u4f7f\u7528<code>columns<\/code>\u5c5e\u6027\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import sqlite3<\/p>\n<p>conn = sqlite3.connect(&#39;example.db&#39;)<\/p>\n<p>query = &#39;SELECT * FROM table_name&#39;<\/p>\n<p>df = pd.read_sql_query(query, conn)<\/p>\n<p>column_names = df.columns.tolist()<\/p>\n<p>print(column_names)<\/p>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528Django ORM<\/strong>\uff1a\u5982\u679c\u4f60\u5728\u4f7f\u7528Django\u6846\u67b6\uff0cDjango\u7684ORM\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u67e5\u8be2\u65b9\u6cd5\u6765\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from django.db import connection<\/p>\n<p>with connection.cursor() as cursor:<\/p>\n<p>    cursor.execute(&#39;SELECT * FROM table_name&#39;)<\/p>\n<p>    column_names = [col[0] for col in cursor.description]<\/p>\n<p>    print(column_names)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u4f7f\u7528PyODBC\u5e93<\/strong>\uff1aPyODBC\u662f\u4e00\u4e2a\u7528\u4e8e\u8fde\u63a5\u548c\u64cd\u4f5cODBC\u6570\u636e\u5e93\u7684Python\u5e93\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528PyODBC\u8fde\u63a5\u5230\u6570\u636e\u5e93\u5e76\u83b7\u53d6\u5217\u540d\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pyodbc<\/p>\n<p>conn = pyodbc.connect(&#39;DRIVER={SQLite3 ODBC Driver};DATABASE=example.db&#39;)<\/p>\n<p>cursor = conn.cursor()<\/p>\n<p>cursor.execute(&#39;SELECT * FROM table_name&#39;)<\/p>\n<p>column_names = [description[0] for description in cursor.description]<\/p>\n<p>print(column_names)<\/p>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u4f7f\u7528\u7684\u6570\u636e\u5e93\u548c\u5e93\u3002\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u4f7f\u7528SQLite3\u3001PyMySQL\u3001Psycopg2\u3001SQLAlchemy\u7b49\u5e93\u83b7\u53d6\u5217\u540d\u7684\u65b9\u6cd5\uff0c\u5e76\u63d0\u4f9b\u4e86\u4ee3\u7801\u793a\u4f8b\u3002\u6b64\u5916\uff0c\u8fd8\u4ecb\u7ecd\u4e86\u4f7f\u7528Pandas\u5e93\u3001Django ORM\u548cPyODBC\u5e93\u83b7\u53d6\u5217\u540d\u7684\u5176\u4ed6\u65b9\u6cd5\u3002\u5e0c\u671b\u8fd9\u4e9b\u65b9\u6cd5\u80fd\u5e2e\u52a9\u4f60\u5728Python\u4e2d\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fde\u63a5\u6570\u636e\u5e93\u4ee5\u83b7\u53d6\u5217\u540d\uff1f<\/strong><br \/>\u8981\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\uff0c\u9996\u5148\u9700\u8981\u4f7f\u7528\u5408\u9002\u7684\u6570\u636e\u5e93\u8fde\u63a5\u5e93\uff0c\u6bd4\u5982<code>sqlite3<\/code>\u3001<code>pymysql<\/code>\u6216<code>sqlalchemy<\/code>\u7b49\u3002\u8fde\u63a5\u5230\u6570\u636e\u5e93\u540e\uff0c\u53ef\u4ee5\u6267\u884cSQL\u67e5\u8be2\u8bed\u53e5\uff0c\u5982<code>SELECT * FROM table_name LIMIT 0<\/code>\uff0c\u7136\u540e\u901a\u8fc7<code>cursor.description<\/code>\u5c5e\u6027\u83b7\u53d6\u5217\u540d\u4fe1\u606f\u3002<\/p>\n<p><strong>\u5728\u83b7\u53d6\u5217\u540d\u65f6\uff0c\u5982\u4f55\u5904\u7406\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u5e93\uff1f<\/strong><br \/>\u4e0d\u540c\u7684\u6570\u636e\u5e93\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\u7684\u8fde\u63a5\u65b9\u6cd5\u548cSQL\u8bed\u6cd5\u3002\u5bf9\u4e8eMySQL\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pymysql<\/code>\u5e93\uff1b\u5bf9\u4e8ePostgreSQL\uff0c\u63a8\u8350\u4f7f\u7528<code>psycopg2<\/code>\u5e93\u3002\u800c\u5bf9\u4e8eSQLite\uff0c\u76f4\u63a5\u4f7f\u7528\u5185\u7f6e\u7684<code>sqlite3<\/code>\u5e93\u5373\u53ef\u3002\u786e\u4fdd\u9009\u62e9\u4e0e\u6240\u7528\u6570\u636e\u5e93\u5339\u914d\u7684\u5e93\uff0c\u5e76\u6839\u636e\u5176\u6587\u6863\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<p><strong>\u83b7\u53d6\u5217\u540d\u65f6\uff0c\u5982\u4f55\u907f\u514dSQL\u6ce8\u5165\u98ce\u9669\uff1f<\/strong><br \/>\u5728\u6267\u884cSQL\u67e5\u8be2\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u53c2\u6570\u5316\u67e5\u8be2\u800c\u975e\u62fc\u63a5\u5b57\u7b26\u4e32\u7684\u65b9\u5f0f\uff0c\u4ee5\u51cf\u5c11SQL\u6ce8\u5165\u7684\u98ce\u9669\u3002\u5927\u591a\u6570Python\u6570\u636e\u5e93\u8fde\u63a5\u5e93\u90fd\u652f\u6301\u8fd9\u79cd\u65b9\u6cd5\uff0c\u901a\u8fc7\u4f7f\u7528\u5360\u4f4d\u7b26\u6765\u5b89\u5168\u5730\u63d2\u5165\u53d8\u91cf\uff0c\u786e\u4fdd\u8f93\u5165\u7684\u6570\u636e\u4e0d\u4f1a\u88ab\u6267\u884c\u4e3aSQL\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u83b7\u53d6\u6570\u636e\u5e93\u7684\u5217\u540d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u53d6\u51b3\u4e8e\u4f60\u4f7f\u7528\u7684\u6570\u636e\u5e93\u548c\u76f8\u5e94\u7684\u5e93\u3002\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528S [&hellip;]","protected":false},"author":3,"featured_media":1047556,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1047550"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1047550"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1047550\/revisions"}],"predecessor-version":[{"id":1047559,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1047550\/revisions\/1047559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1047556"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1047550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1047550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1047550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}