[問題] 關聯式資料表 select 問題
我有兩張表用共用一個ID來查詢
那請想問一下我怎麼同時從兩張表取出欄位資料
我是用DataFrame 做資料庫存取 , 還是我只能分別從資料表出來在對DataFrame 欄位做合併?
#! /usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import sqlite3 as lite
with lite.connect('') as db:
df = pd.read_sql_query("select * from table where ID =
'ID_NUMBER'" , db)
print df
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.181.189.156
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1493645435.A.50D.html
推
05/02 10:48, , 1F
05/02 10:48, 1F
推
05/06 20:37, , 2F
05/06 20:37, 2F