擅长:python、mysql、java
<p>如果您查看pymssql文档,就会看到cursor对象有一个<a href="http://pymssql.org/en/latest/ref/pymssql.html#pymssql.Cursor.fetchone" rel="nofollow">^{<cd1>}</a>方法。</p>
<pre><code>with engine.connect() as connection:
cursor = connection.cursor()
cursor.execute("""SELECT DISTINCT Distributor FROM Product""")
first_row = cursor.fetchone()
print first_row
</code></pre>