Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pythonコードの中に複数行SQLを書く ref: http://qiita.com/yubessy/items/86032d332ac86c1abe67
sql_stmt = "CREATE TABLE Test(" \
"id INTEGER PRIMARY KEY, " \
"val TEXT NOT NULL)"
sql_stmt = """CREATE TABLE Test(
id INTEGER PRIMARY KEY,
val TEXT NOT NULL)"""
sql_stmt = (
"CREATE TABLE Test("
"id INTEGER PRIMARY KEY,"
"val TEXT NOT NULL)")
sql_stmt = (
"SELECT * FROM Test" # 最後に空白を入れないと次の行と繋がって構文エラーになる
"WHERE id < 10")
sql_stmt = " ".join((
"SELECT * FROM Test",
"WHERE id < 10"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment