Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Just another Perl shrine
 
PerlMonks  

erix's scratchpad

by erix (Priest)
on Oct 15, 2004 at 21:01 UTC ( #399662=scratchpad: print w/ replies, xml ) Need Help??

---------------------------------------------------- -- data of the OP: select * from (values(1,'A'),(2,'A'),(3,'A'),(3,'B'),(4,'B')) as f(id, + type); select * from ( select id , sum(case type when 'A' then 1 else 0 end) as a_count , sum(case type when 'B' then 1 else 0 end) as b_count from (values(1,'A'),(2,'A'),(3,'A'),(3,'B'),(4,'B')) as f1(id, ty +pe) -- your_table group by 1 ) as f2 where a_count > 0 and b_count > 0; ----------------------------------------------------


Can you color Ratty? ___ / \\ ______ \ // / \/ o \ ________/ \ \_ \__\ \-----o \____|\__|
-- -- Windows dev Install: -- Installing postgres on windows as a unpriviledged user (avoiding the n +ecessity of administrator rights): -- download zip file; http://www.enterprisedb.com/products-services-training/pgbindownload "Binaries from installer version 9.2.2" -- unzip the pgsql directory somewhere, and cd into it: cd pgsql -- run initdb: bin\initdb -D 9.2\data -- to start postgres: "bin\pg_ctl" -D "9.2/data" -l logfile start -- to stop: close all connections, and then run: "bin\pg_ctl" -D "9.2/data" -l logfile stop default port will be: 5432 (Install DBI + DBD::Pg to connect via perl ) I ran this on a rather old win2k, but it will probably also work on ne +wer windows. (wiggle slashes a bit and it will work on linux too (with the proper f +ile download, of course)) perl -MDBI -Mstrict -e 'my$dbh=DBI->connect("dbi:Pg:port=5432;db=postg +res;", undef, undef,{RaiseError=>1}); print $dbh, "\n"'; output: DBI::db=HASH(0x1b5a808) -> apparently the connection succeeded
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (18)
As of 2013-05-23 17:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (486 votes), past polls