[SQL] unsubscribe

2005-09-29 Thread noor
please take me out from this group. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Sending function parametars within EXECUTE ''SELECT...

2005-09-29 Thread Mario Splivalo
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

Re: [SQL] Sending function parametars within EXECUTE ''SELECT...

2005-09-29 Thread Stewart Ben (RBAU/EQS4) *
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

Re: [SQL] Sending function parametars within EXECUTE ''SELECT...

2005-09-29 Thread Mario Splivalo
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...

Re: [SQL] Selecting count of details along with details columns

2005-09-29 Thread 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 set breaks

Re: [SQL] Selecting count of details along with details columns

2005-09-29 Thread Axel Rau
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

Re: [SQL] Selecting count of details along with details columns

2005-09-29 Thread Richard Huxton
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

[SQL] EXECUTE with SELECT INTO variable, or alternatives

2005-09-29 Thread Mario Splivalo
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

Re: [SQL] Selecting count of details along with details columns

2005-09-29 Thread Axel Rau
-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)

Re: [SQL] Selecting count of details along with details columns

2005-09-29 Thread Scott Marlowe
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:

[SQL] unsubscribe

2005-09-29 Thread Ricky Sutanto
Please unsubscribe me