在PostgreSQL程序中使用HTML链接

时间:2013-08-21 02:43:42

标签: postgresql

我试图在PostgreSQL程序中使用HTML链接以及一些局部变量。但是,我在判断括号时会出现语法错误。像

这样的东西
  '<a href="http://www.google.com/trends/explore#q='my_variable'" target=\"_blank\">' my_variable '</a>' 

但是,我收到语法错误。我认为它与转义字符有关。任何帮助将不胜感激。

谢谢, 德里克

1 个答案:

答案 0 :(得分:1)

使用它:

 '<a href="http://www.google.com/trends/explore#q=''my_variable''" target=\"_blank\">' || my_variable || '</a>'