)
GROUP BY name ORDER BY name;
I would also inspect the subquery, ordered by name, to see if anything
weird leaps out at you in terms of the adjacent rows that *should* be
grouped. As an aside, I replaced the (x = 0 OR x IS NULL) and converse
constructions with COALESCE() functions, which IMO are
descr
from (select distinct freephone
from calendario order by 1) as a
) as b;
sql := $$select *
FROM crosstab('select uscita,freephone,id from calendario order by
1','select distinct freephone from calendario order by 1
y_agg
-
{5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
Thanks,
--Lee
--
Lee Hachadoorian
PhD, Earth & Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu/
On 03/15/2012 12:23 PM, Tom Lane wrote:
Lee Hachadoorian writes:
COPY ... TO ... WITH CSV defaults to quoting string fields with embedded
delimiters, quotes, and newlines. In pgAdmin I can execute to file and
specify "no quoting" for the output, in which case I get (what I want) a
fi
string had to be at least one character.
Any ideas?
Best,
--Lee
--
Lee Hachadoorian
PhD, Earth& Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make chan
so that they don't overlap anymore, there won't be any left that overlap two
or three or more ranges. This can be accomplished with:
WITH rank_epc AS (
SELECT
record_id,
epc_decimal_start AS range_low,
epc_decimal_start + quantity AS range_high,
rank() OVER (ORDER BY epc_decimal_start)
FROM
ft
1, b_col1, a_col2, b_col2 ... for easy
> comparison. And who can make sense of a 100 column results set anyway?:)
>
I don't know if someone has come up with a workaround, but to begin with
note that the docs specify that when using the * "it is not possible to
specify new names with
Perfect. Thanks, --Lee
On 12/14/2010 03:23 AM, Filip Rembiałkowski wrote:
try
select zip, count(distinct id) from customer_service_date group by
zip;
2010/12/14 Lee Hachadoorian <lee.hachadoor...@gmail.com>
teger,
address character varying,
city character varying,
state character varying,
zip character varying,
service_date date
)
;
The table is missing a primary key field, but it would be (id,
service_date) if it had one.
Any suggestions to improve this?
Thanks,
--Lee
--
Lee Hachadoorian
PhD St
se? I believe I have
> postGIS install and now I want to load the US counties shp file.
>
> the following does not appear to work
> shp2pgsql -s 4269 -I -W latin1 tl_2008_us_county.shp 2008_us_county | psql
>
> Plus I don't know what it does!
>
> Johnf
>
>
--
()
Limit 10;
I don’t want to bring back the random number I
just
want the sort order to be random. How can I sort randomly? This query
breaks
because random() is not in the select.
Thanks
Pam
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environme
et me
know.
I am waiting for your great response.
Thanks and Regards,
Venkat
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
hether
it makes more sense to do this via these function calls.
--Lee
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
but f_project_acl returned FALSE
OR
(2) there is no matching event, there IS a matching customer, but
f_customer_acl returned FALSE
And of course you don't know which plan_ids these might be true of.
--Lee
2010/7/14 Lee Hachadoorian :
> SELECT newfunc(uid);
>
> CREATE FU
ELECT statements to 1 SELECT statement.
Obviously, not tested. Hope this is helpful.
--Lee
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Thanks. That was a fairly recent post, too, but I couldn't come up with
the right keyword search to find it.
On 06/25/2010 07:25 PM, Adrian Klaver wrote:
> On Friday 25 June 2010 3:53:01 pm Lee Hachadoorian wrote:
>
>> Is it documented anywhere that floating-po
r. Wouldn't that have to be
intentionally programmed that way?
--Lee
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://ww
ing to use round(a::real/b::real)
to generate a rounded result to dividing integers, and noticed sometimes
0.5 was truncated and sometimes it was rounded up. Couldn't find
anything about this in the archives or the data type documentation. Is
there something obvious that I'm I missing
Thanks Tom & Pavel, these are very helpful.
On Fri, Jun 25, 2010 at 12:29 PM, Pavel Stehule wrote:
> Hello
>
> 2010/6/25 Lee Hachadoorian :
>> Is there a function that returns the average of the elements of an
>> array? I'm thinking of something that would wo
ot missing something.
Thanks,
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Assuming I define a column naics as
ltree, being able to query WHERE nlevel(naics) = [2|3|4] will work
nicely, and with the right views, my users never have to see it.
Thanks again to everyone who replied. Any further remarks, questions,
comments are welcome.
--Lee
--
Lee Hachadoorian
PhD Studen
s be broken into separate columns? Should parent
ids be stored in each node?
More generally, what questions should I be asking to help decide what
structure makes the most sense? Are there any websites, forums, or books
that cover this kind of problem?
Regards,
--Lee
--
Lee Hachadoorian
PhD Stud
the final columns of
the crosstab should just be blank.
PS: The way I have constructed it, I would avoid using WHERE date >=
''2010-01-01''. If data from February gets into the table, it will aggregate
data from, e.g. Jan 2 and Feb 2 as both being part of "Day 2".
--Lee
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
l the category headers
from your source table like this:
'SELECT DISTINCT date_trunc(''day'', date) AS day WHERE date >=
''2010-01-01'' ORDER BY 1'
Let me know if this gets you anywhere.
--Lee
On Mon, Feb 1, 2010 at 11:52 AM, Adam Sherm
hould
be enough to trick the crosstab function into thinking it has something to
fill the last columns.
--Lee
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
On Wed, Nov 18, 2009 at 2:30 PM, Pavel Stehule wrote:
> yes, and don't use 20%.
>
> select * from foo order by somecol limit (select (count(*)*0.2)::int from foo)
>
> Regards
> Pavel
Is this faster on a large table? Because (select (count(*)*20/100)) worked fine.
--
Sent via pgsql-sql mailing l
. like:
> select * from client limit 20%
> I have tried (of course, with no success) this:
> select * from client limit ((select count(*) from client)*20/100)
>
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
--
Sent via
ciated. Thanks,
--Lee
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
28 matches
Mail list logo