please take me out from this group.
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
On Wed, 2005-09-28 at 10:01 -0700, codeWarrior wrote:
---(end of
broadcast)---
TIP 5: don't forget to increase your free space map settings
FOR rec IN EXECUTE ''SELECT COUNT(col1) AS num FROM tmpTbl WHERE col2
= ||
aBid || '' LOOP
Is there a way to assing variable a value returned from query that
accesses the temporary table in a way you explained above?
For instance, I can do:
myValue := col2 FROM tmpTbl WHERE someValue = somethingElse...
If I'm parsing this correctly, all you need do is:
SELECT col2 INTO myValue
On Thu, 2005-09-29 at 16:36 +1000, Stewart Ben (RBAU/EQS4) * wrote:
Is there a way to assing variable a value returned from query that
accesses the temporary table in a way you explained above?
For instance, I can do:
myValue := col2 FROM tmpTbl WHERE someValue = somethingElse...
Axel Rau wrote:
SELECT T2.T2_name, COUNT(T1.id) AS xx
FROM T2, T1
WHERE T2.id = T1.fk_t2
GROUP BY T2.T2_name
HAVING COUNT(T1.id) 1
ORDER BY xx DESC;
t2_name | xx
-+
T2-N2 | 3
T2-N3 | 2
(2 rows)
Adding column t1_name to the result set breaks
Am 29.09.2005 um 10:30 schrieb Richard Huxton:
Axel Rau wrote:
SELECT T2.T2_name, COUNT(T1.id) AS xx
FROM T2, T1
WHERE T2.id = T1.fk_t2
GROUP BY T2.T2_name
HAVING COUNT(T1.id) > 1
ORDER BY xx DESC;
t2_name | xx
-+
T2-N2 | 3
T2-N3 | 2
(2 rows)
Adding column t1_name to the result
Axel Rau wrote:
Am 29.09.2005 um 10:30 schrieb Richard Huxton:
Axel Rau wrote:
SELECT T2.T2_name, COUNT(T1.id) AS xx
FROM T2, T1
WHERE T2.id = T1.fk_t2
GROUP BY T2.T2_name
HAVING COUNT(T1.id) 1
ORDER BY xx DESC;
t2_name | xx
-+
T2-N2 | 3
T2-N3 | 2
I can assign a value to a variable in several ways:
myVar := (SELECT col FROM table WHERE somecondition...)
myVar := col FROM table WHERE somecondtition...
SELECT col INTO myVar FROM table WHERE somecondition
How do I do any of the above using EXECUTE? I need to be able to assign
the value to a
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Am 29.09.2005 um 12:03 schrieb Richard Huxton:
Axel Rau wrote:
Am 29.09.2005 um 10:30 schrieb Richard Huxton:
Axel Rau wrote:
...
Ah - this is two questions:
1. What are the unique (t2_name,t1_name) pairings?
2. How many different (t1.id)
On Thu, 2005-09-29 at 14:08, Axel Rau wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Exactly, that query works as I expected. Thank you.
Can you answer this question as well:
Looking for a workaround, I learned that aggregate functions are not
allowed in WHERE clauses.
Question:
Please unsubscribe me
11 matches
Mail list logo