On Thu, Aug 20, 2009 at 10:17 AM, Gerardo Herzig wrote:
> Hi all. I have 2 functions , which returns the same columns, but with
> tottaly different logics. I want to wrap it with a third function, who
> will receive a boolean argument to decide wich sub-function have to use.
>
> I want to use case,
2008/12/25 Karl Denninger :
> Assuming a table containing:
>
> name text
> address text
> uri text
>
> I wish to run a query that will return those rows where:
>
> ("name" is not null) AND (distinct) (uri is the same for two or more entries
> AND name is different between the two entries))
>
> Exam
On Wed, Nov 19, 2008 at 10:03 PM, novice <[EMAIL PROTECTED]> wrote:
> sorry I get nothing :(
Of course not. None of the dates you gave in the example overlap.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pg
On Fri, May 30, 2008 at 4:21 AM, Allan Kamau <[EMAIL PROTECTED]> wrote:
> Expected tests may be:
> 14 weeks yields 3 months.
> 1 weeks yields 0 months.
Assuming 4 week months:
SELECT 14 / 4 AS "3 months", 1 / 4 AS "0 months"
3 months | 0 months
--+--
3 |0
(1 row)
On Wed, Mar 26, 2008 at 5:45 PM, Shawn <[EMAIL PROTECTED]> wrote:
> obviously it doesn't like the extra single quotes around the 1 msec. Any
> suggestions for a work around?
Use dollar quoting, e.g.:
create or replace function dur_interval_msec(int) returns interval
as
$$
select ($1 * interval
On 3/19/08, Christopher Crews <[EMAIL PROTECTED]> wrote:
> and what I'm trying to do is fill in the missing dates with sales values of 0.
create or replace function gen_dates(sd date, ed date)
returns setof date as $$
select $1 + i
from generate_series(0, $2 - $1) i;
$$ language sql immutable;
se
On Tue, Mar 11, 2008 at 2:03 PM, Dirk Jagdmann <[EMAIL PROTECTED]> wrote:
> For my tests, I have modified your posted schema a bit, to
> unify all column names to "name".
OT and IMHO, this is not good practice. Column names should be unique
and descriptive throughout the entire schema.
--
Sent
On Tue, Feb 26, 2008 at 11:36 AM, Shavonne Marietta Wijesinghe
<[EMAIL PROTECTED]> wrote:
> BEGIN
> SAVEPOINT s1;
> ... code here ...
> EXCEPTION
> WHEN ... THEN
> ROLLBACK TO s1;
> ... code here ...
> WHEN ... THEN
> ROLLB
On Fri, Feb 15, 2008 at 11:09 AM, Emi Lu <[EMAIL PROTECTED]> wrote:
> Str1 = "test test caa dtest testing EndofString";
> Str2 = " ";
>
> select funcName(Str1, Str2);
>
> return 5
CREATE OR REPLACE FUNCTION
FOOBAR(TEXT,TEXT)
RETURNS INT AS $$
SELECT(LENGTH($1) - LENGTH(REPLACE(
On Jan 15, 2008 1:04 PM, Bryan Emrys <[EMAIL PROTECTED]> wrote:
> In other words, in the sample above, I only want to return:
> 'Canada','Ireland',0
> 'Canada','Netherlands',5
Try (untested):
SELECT t2.*
FROM (SELECT payor
FROM treaty_rates
WHEREpayee IN ('Netherlands'
On Dec 31, 2007 1:52 PM, Josh <[EMAIL PROTECTED]> wrote:
> Instead, I just want:
>
> 1 A Cat In The HatDr. Seuss
SELECT books.book_id, books.title,
(SELECT author_name
FROM authors
WHERE book_id = books.book_id
LIMIT 1) AS author_name
FROM books
WH
11 matches
Mail list logo