我试图在PostgreSQL程序中使用HTML链接以及一些局部变量。但是,我在判断括号时会出现语法错误。像
这样的东西 '<a href="http://www.google.com/trends/explore#q='my_variable'" target=\"_blank\">' my_variable '</a>'
但是,我收到语法错误。我认为它与转义字符有关。任何帮助将不胜感激。
谢谢, 德里克
答案 0 :(得分:1)
使用它:
'<a href="http://www.google.com/trends/explore#q=''my_variable''" target=\"_blank\">' || my_variable || '</a>'