含%的字符串格式化

a = 'zengziji_sz'

sql = """

select ctype

from IO_HI.dbo.MESSAGE_QUEUE

where ctime>='20181009 08:00:00'

and receiver like '%%%s%%'

and ctype like '%%昨日%%'

group by ctype;

"""%a

推荐阅读更多精彩内容