iT邦幫忙

1

python sql語法 在command 裡加入變數

  • 分享至 

  • twitterImage

不好意思,小弟剛使用mariaDB,這邊是使用python進行操作,但不大熟悉裡面的指令與操作,希望請求各位大神的幫助

https://ithelp.ithome.com.tw/upload/images/20210725/201398559oQMEsfXf8.png
我想把上方的程式定義成function,能夠查詢platform跟topic兩個column中不重複的值,試了以下兩種方式都失敗:
1.
https://ithelp.ithome.com.tw/upload/images/20210725/20139855cdVKhuDqT2.png
2.
https://ithelp.ithome.com.tw/upload/images/20210725/20139855RcLLb1fn2C.png
想知道上方的code如何改正,麻煩各位大神回答了

froce iT邦大師 1 級 ‧ 2021-07-26 08:06:15 檢舉
(f"{column}",)
少了一個 , 就不是tuple了
froce iT邦大師 1 級 ‧ 2021-07-26 11:07:55 檢舉
然後下次記得貼在code block裡,我看不到你的錯誤訊息,圖片太小。
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答