我想替换:
http://ipAddress:8080/appName/
在字符串中:
sum("PUBLIC"."ORDERS"."TOTAL") AS "sum"
问题是引用SELECT "PUBLIC"."ORDERS"."TAX" AS "TAX", sum("PUBLIC"."ORDERS"."TOTAL") AS "sum" FROM "PUBLIC"."ORDERS" GROUP BY "PUBLIC"."ORDERS"."TAX" ORDER BY "PUBLIC"."ORDERS"."TAX" ASC
,括号"
(
和点)
答案 0 :(得分:1)
引号只需要在它们前面加一个反斜杠:
user=> (def s "SELECT \"PUBLIC\".\"ORDERS\".\"TAX\" AS \"TAX\", sum(\"PUBLIC\".\"ORDERS\".\"TOTAL\") AS \"sum\" FROM \"PUBLIC\".\"ORDERS\" GROUP BY \"PUBLIC\".\"ORDERS\".\"TAX\" ORDER BY \"PUBLIC\".\"ORDERS\".\"TAX\" ASC")
#'user/s
user=> (.replace s "sum(\"PUBLIC\".\"ORDERS\".\"TOTAL\") AS \"sum\"" "new string")
"SELECT \"PUBLIC\".\"ORDERS\".\"TAX\" AS \"TAX\", new string FROM \"PUBLIC\".\"ORDERS\" GROUP BY \"PUBLIC\".\"ORDERS\".\"TAX\" ORDER BY \"PUBLIC\".\"ORDERS\".\"TAX\" ASC"