声明变量 [英] Declaring a Variable
本文介绍了声明变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通常会按以下方式声明一个变量...
DECLARE @myVariable Text
SET @myVariable =''页面''
选择
@myVariable
来自
coredata
如何在PostgreSQL(... pgAdmin III)查询中进行更改?
I would normally declare a variable in the following manner...
DECLARE @myVariable Text
SET @myVariable = ''pages''
SELECT
@myVariable
FROM
coredata
How would this change in PostgreSQL (...pgAdmin III) query?
推荐答案
看看这里:
http:// stackoverflow .com / a / 1491329 [ ^ ]
Hi,
Have a look here:
http://stackoverflow.com/a/1491329[^]
PostgreSQL中没有这样的功能。您只能在pl / PgSQL(或其他pl / *)中执行此操作,但不能在纯SQL中执行。
There is no such feature in PostgreSQL. You can do it only in pl/PgSQL (or other pl/*), but not in plain SQL.
这篇关于声明变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文