📜  if query empty print python 代码示例

📅  最后修改于: 2022-03-11 14:46:46.156000             🧑  作者: Mango

代码示例1
# cursor.rowcount will usually be set to 0.

if cursor.rowcount == 0:
  print("No results")
  elif cursor.rowcount > 0:
    for results in result_from_query:
      print(results)