On Wed, May 23, 2012 at 12:07 PM, Lee Hachadoorian <
lee.hachadooria...@gmail.com> wrote:
> On Wed, May 23, 2012 at 5:24 AM, Ferruccio Zamuner
> wrote:
> > Hi,
> >
> > I like PostgreSQL for many reasons, one of them is the possibility to use
> > sub query everywhere. Now I've found where it doesn
On Wed, May 23, 2012 at 5:24 AM, Ferruccio Zamuner wrote:
> Hi,
>
> I like PostgreSQL for many reasons, one of them is the possibility to use
> sub query everywhere. Now I've found where it doesn't support them.
>
> I would like to use a AS (sub query) form.
>
> This is an example:
>
> First the s
Hi,
I like PostgreSQL for many reasons, one of them is the possibility to
use sub query everywhere. Now I've found where it doesn't support them.
I would like to use a AS (sub query) form.
This is an example:
First the subquery:
select substr(descr, 7, length(descr)-8)
from (select string
Michael Burke <[EMAIL PROTECTED]> writes:
> Is it possible to execute a SELECT query as an argument to a function?
> SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio);
You need parentheses around the sub-SELECT.
SELECT my_func('Sample', NULL, (SELECT MIN(year) FROM audio));
This is
On December 20, 2005 10:52 am, Jaime Casanova wrote:
> have you tried?
Yes:
=> SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio);
ERROR: syntax error at or near "SELECT" at character 32
PostgreSQL 7.4.9, myfunc is pl/pgsql.
Just found a working method, though:
=> SELECT my_func('Sam
On 12/20/05, Michael Burke <[EMAIL PROTECTED]> wrote:
> Is it possible to execute a SELECT query as an argument to a function?
>
have you tried?
--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)
---(end of broadcast)---
TIP 2: Don't 'kill -9
Is it possible to execute a SELECT query as an argument to a function?
Example:
SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio);
In my particular case, my_func inserts columns into another table; I wish to
use values from another table as the arguments. The interior SELECT will
re
Martin Kuria writes:
> Hi again I have this problem when I try to run this query, how can I rewrite
> it for it to work.
>
> SELECT o.item_order_num,SUM(o.item_quantity + o.item_product_id) As total,
> o.item_status
> FROM soko_product p, soko_ordered_item o
> WHERE p.product_id = o.item_product_i
]
++
From: Christoph Haller <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [SQL] sub query
Date: Wed, 17 Sep 2003 10:54:49 +0200
>
> > Hi I have this problem, when I try to run this query:
> >
> > SELECT MAX(d), host_position FROM (SELE
The reason why the first one
SELECT MAX(e.d), e.host_position FROM (SELECT host_position,
COUNT(host_position) as d FROM sss_host GROUP BY host_position) as e
GROUP BY e.host_position ORDER BY 1 LIMIT 1;
did not work is because the query needs a
ORDER BY 1 DESC LIMIT 1 like the second one.
Mind the
ED]
CC: [EMAIL PROTECTED]
Subject: Re: [SQL] sub query
Date: Wed, 17 Sep 2003 10:54:49 +0200
>
> > Hi I have this problem, when I try to run this query:
> >
> > SELECT MAX(d), host_position FROM (SELECT host_position,
> > COUNT(host_position) as d FROM sss_host GROUP B
>
> > Hi I have this problem, when I try to run this query:
> >
> > SELECT MAX(d), host_position FROM (SELECT host_position,
> > COUNT(host_position) as d FROM sss_host GROUP BY host_position) as
e;
> >
> > am getting and ERROR: Attribute e.host_position must be GROUPed or
> used in
> > an aggregat
> Hi I have this problem, when I try to run this query:
>
> SELECT MAX(d), host_position FROM (SELECT host_position,
> COUNT(host_position) as d FROM sss_host GROUP BY host_position) as e;
>
> am getting and ERROR: Attribute e.host_position must be GROUPed or
used in
> an aggregate function.
>
> Pl
Hi I have this problem, when I try to run this query:
SELECT MAX(d), host_position FROM (SELECT host_position,
COUNT(host_position) as d FROM sss_host GROUP BY host_position) as e;
am getting and ERROR: Attribute e.host_position must be GROUPed or used in
an aggregate function.
Please to advic
Hi I have this problem, when I try to run this query:
SELECT MAX(d), host_position FROM (SELECT host_position,
COUNT(host_position) as d FROM sss_host GROUP BY host_position) as e;
am getting and ERROR: Attribute e.host_position must be GROUPed or used in
an aggregate function.
Please to advic
On Fri, 2003-02-14 at 04:59, Tomasz Myrta wrote:
> Brad Hilton wrote:
>
> > select * from articles where exists
> > (select 1 from article_categories, categories, category_map
> >where
> >article_categories.article_id = articles.id and
> >categories.restrict_views = FALSE and
> >
On Fri, 2003-02-14 at 14:08, Tom Lane wrote:
> Brad Hilton <[EMAIL PROTECTED]> writes:
> > ... If I modify the query slightly:
>
> >
> > select 1 from article_categories
> > -->
> > select 1 from articles, article_categories
> > -
>
> > the query takes 98 msec.
>
> Yeah, becau
On 14 Feb 2003, Brad Hilton wrote:
> I am hoping someone can help explain why modifying the following query
> can effect such a huge change in speed. The query is:
>
> select * from articles
> where exists
>( select 1 from article_categories
> where
> articl
18 matches
Mail list logo