Thank you very much for your response. However, I'm unclear what you want
me to substitute for sum(...)?
select '1' as "num_ads", sum(...)
from
(select a.userid from
user_event_stg2 a, user_region b
where a.userid = b.userid
and b.region_code = 1000
and a.messagetype = 'impression'
group by a.user
The following is my code and results:
select '1' "num_ads",
(case when r.region_code = 1000 then (
select count(*) from (
select userid from user_event_stg2 where userid in (
select userid from user_region where region_code = 1000)
and messagetyp
The following is my code and results:
select '1' "num_ads",
(case when r.region_code = 1000 then (
select count(*) from (
select userid from user_event_stg2 where userid in (
select userid from user_region where region_code = 1000)
and messagetyp
VALUES (now(), ...)
>
> and, for the select, you could simply write :
>
> SELECT * FROM tablename WHERE insertion_time >= (now() - interval '1
> day')
>
>
>
> 2012/1/9 Adrian Klaver
> On Monday, January 09, 2012 8:28:43 am Tony Capobianco
On Mon, 2012-01-09 at 08:19 -0800, Adrian Klaver wrote:
> On Monday, January 09, 2012 8:12:18 am Tony Capobianco wrote:
> > I have these 3 tables:
> >
> > tablename
> >
> > tmp_staging0109
> > tmp_staging1229
> > tmp_staging
I have these 3 tables:
tablename
tmp_staging0109
tmp_staging1229
tmp_staging0108
I'd like this query:
select tablename from pg_tables where tablename like 'tmp_staging%' and
tablename < 'tmp_staging1230';
To return this result:
tablename
Use the concat || operator.
On Thu, 2011-08-25 at 15:21 +0100, gvim wrote:
> I have to deal with a table which contains:
>
> first_name
> surname
> email1
> email2
>
> ... and I would like to create a view which combines both email columns thus:
>
> first_name
> surname
> email
>
> It looks s
Ok, I think I found it:
select translate(firstname,'"','') from members;
gives me what I want.
Thanks.
On Wed, 2011-05-11 at 16:29 -0400, Tony Capobianco wrote:
> We are converting from Oracle to Postgres. An Oracle script contains
> this line:
>
> se
We are converting from Oracle to Postgres. An Oracle script contains
this line:
select replace(firstname,'"'), memberid, emailaddress from members;
in an effort to replace the " with nothing. How can I achieve the same
result with Postgres?
Here's the Postgres error I get:
select replace(fir
Tom,
That's a frighteningly easy solution.
Thanks.
Tony
On Tue, 2011-02-15 at 16:10 -0500, Tom Lane wrote:
> Tony Capobianco writes:
> > I'm altering datatypes in several tables from numeric to integer. In
> > doing so, I get the following error:
>
> &g
Pavel,
That's perfect!
Thanks.
Tony
On Tue, 2011-02-15 at 22:04 +0100, Pavel Stehule wrote:
> Hello
>
> probably you have to use a explicit cast
>
> postgres=# select length(10::numeric::text);
> length
>
> 2
> (1 row)
>
> Regards
I'm altering datatypes in several tables from numeric to integer. In
doing so, I get the following error:
dw=# \d uniq_hits
Table "support.uniq_hits"
Column | Type | Modifiers
+-+---
sourceid | numeric |
hitdate| date|
total | numeric |
Hi,
I'm successfully executing the below:
create role developer login;
alter role developer set default_tablespace=dev;
alter role developer set search_path=dev,staging, esave, support, email,
public;
grant select on members to developer;
grant create on schema dev to developer;
However, when I
Here's my table:
plsql_dw=# \d tmpsv_parent_master
Table "staging.tmpsv_parent_master"
Column |Type | Modifiers
+-+---
memberid | numeric |
addeddate | timestamp witho
We're in the process of porting our Oracle 10.2 datawarehouse over to
PostGres 8.4. One thing we rely upon are daily/hourly reports that are
run and formatted in sqlplus (break on report, compute sum, etc.). Is
there an equivalent available in postgres?
Thanks.
Tony
--
Sent via pgsql-sql mail
r wrote:
> I don't know what Postgres version you're using but check out the doc
> related to String Functions and Operators.
> Cheers,
>Peter
>
>
> On Tue, Dec 7, 2010 at 4:47 PM, Tony Capobianco
> wrote:
> Ok, that worked. Why did I need to cast
4005943492010-11-16 19:35:22
4005943662010-11-16 19:35:37
(5 rows)
Thanks.
On Tue, 2010-12-07 at 16:43 -0500, Peter Steinheuser wrote:
> I think the HINT is what you need to look at.
>
> Cast both columns to text.
>
> On Tue, Dec 7, 2010 at 4:37 PM, Tony Capobianco
> wrote
Here's my table:
plsql_dw=# \d tmpsv_parent_master
Table "staging.tmpsv_parent_master"
Column |Type | Modifiers
+-+---
memberid | numeric
18 matches
Mail list logo