Re: [SQL] "How do I ..." SQL question

2005-01-25 Thread Bob
------ > >3 joe2004 s,e,e > >2 bob2003 w,e > >2 kim2003 s,s > >2 sue2004 s,w > > > > Select only places visited included in LIMITed query: > > > Is this : > > SELECT DISTINCT place

[SQL] ORDER BY case insensitive?

2001-10-04 Thread Bob Swerdlow
letter. I want them all in alphabetic order, regardless of case. I've looked in PostgreSQL Introduction and Concepts by Bruce Momjian and in the FAQ at http://postgresql.overtone.org/docs/faq-english.html Thanks for your help. -- Bob Swerdlow Chief Operating Officer Transpose, LLC [

Re: [SQL] Simple Query HELP!!!

2001-09-27 Thread Bob Barrows
PEOPLE > >NAME AGE COMPANY >Bob 33 Acme >Jane30 Acme >Bill20 Acme >Jose56 ATech >Siu 40 ATech >Paolo 28 IBM >Maria 38 IBM > >I need a query than will return a list with the seniors per company >like > &

Re: [SQL] ORDER BY case insensitive?

2001-10-05 Thread Bob Swerdlow
need to uppercase all of the data before adding to the table? (yuk) - Bob - Original Message - From: "Jason Earl" <[EMAIL PROTECTED]> To: "Bob Swerdlow" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, October 04, 2001 3:47 PM Subject: Re:

[SQL] SQL reference card

2001-10-15 Thread Bob Vloon
Hello, I'm looking for a reference card for SQL. I've searched quite a lot, but a simple card in PostScript/PDF seems to be hiding for me ;) Anyone?? Thanx in advance, Bob.. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] What benefits can I expect from schemas ?

2003-01-08 Thread Bob Lapique
Hi, I could not find much documentation about SQL 92 schemas that version 7.3 now supports. I understood it was a structure to group various objects, which allows faster privilege management, namespaces definition. Besides that, I don't see any advantages. I'd be glad if someone could point them o

[SQL] Cross joining table with itself

2003-09-21 Thread Bob Hutzel
I've been stumped trying to solve this problem via SQL. I have a table ID, member1, member2, member3. In any row, any member field may have a value or be null. I want to tally up how many times each member appears in the table as a whole. For example, if two entries were ('a', '', 'c') and ('b', 'c

[SQL] Problem with intervals

2003-12-01 Thread Bob Smith
time shift, October 26 was 25 hours long this year. Is this a Postgres bug, or is this correct SQL behavior? I'm running Postgres 7.2.2. Bob S. ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Problem with intervals

2003-12-02 Thread Bob Smith
On Tuesday, Dec 2, 2003, at 03:53 US/Pacific, Alexander M. Pravking wrote: On Mon, Dec 01, 2003 at 09:09:20PM -0800, Bob Smith wrote: I'm getting an unexpected result using intervals in an expression: select ('2003-10-26 0:00:00'::timestamp + '1 day'::

[SQL] How to make a portable application?

2004-07-01 Thread Bob Hobart
I am sure that this is way too broad of a question to ask here, but heck, if anyone has any thoughts it would be helpful.   I wonder, how do you make a truly portable sql application?  You see apps out there that can run on just about any SQL server.  I have always wondered how they can do

[SQL] Query plan discrepancies

2004-07-16 Thread Bob Arens
other one will hang for 15 minutes or so before I get annoyed enough to kill it. Here's the kicker - yes, the table sizes in the DBs is different, but the _larger_ database is the one that's returning! This confuses me; thoughts? - Bob The statement: select norm,count(norm) from medline_

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Bob Henkel
On Apr 8, 2005 1:10 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Fri, 2005-04-08 at 12:08, Joel Fradkin wrote:> Thanks all.> I might have to add a button to do the count on command so they don't get> the hit.> I would want it to return the count of the condition, not the currently> displayed num

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Bob Henkel
On Apr 8, 2005 2:23 PM, Joel Fradkin <[EMAIL PROTECTED]> wrote: Believe me I just spent two months converting our app, I do not wish to giveup on that work. We do a great deal more then count. Specifically many ofour queries run much slower on postgres. As mentioned I purchased a 4 procbox with 8 g

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Bob Henkel
On Apr 8, 2005 3:23 PM, Vivek Khera <[EMAIL PROTECTED]> wrote: On Apr 8, 2005, at 3:23 PM, Joel Fradkin wrote:> I set up the data on 4 10k scsi drives in a powervault and my wal on 2> 15k> drives. I am using links to those from the install directory. It> starts and> stops ok this way, but maybe it

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Bob Henkel
On Apr 8, 2005 3:42 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Fri, 2005-04-08 at 15:35, Bob Henkel wrote:> On Apr 8, 2005 3:23 PM, Vivek Khera <[EMAIL PROTECTED]> wrote:> On Apr 8, 2005, at 3:23 PM, Joel Fradkin wrote:>> > I set up the dat

Re: [SQL] getting count for a specific querry

2005-04-09 Thread Bob Henkel
On Apr 9, 2005 10:00 AM, John DeSoi <[EMAIL PROTECTED]> wrote:On Apr 8, 2005, at 3:37 PM, Joel Fradkin wrote:> I don't think my clients would like me to aprox as it is a count of> their> records. What I plan on doing assuming I can get all my other problems> fixed> (as mentioned I am going to try a

[SQL] calculate time diffs across rows with single timestamp

2007-06-13 Thread Bob Singleton
'in' stamp of the latter record by type/id became the 'out' stamp of the previous record) and I simply subtracted the in from the out time in a sum() with grouping.) Thanks, Bob ---(end of broadcast)--- TIP 9: In versions belo

Re: [SQL] calculate time diffs across rows with single timestamp

2007-06-13 Thread Bob Singleton
Rodrigo De León wrote: On Jun 13, 11:17 am, [EMAIL PROTECTED] (Bob Singleton) wrote: Any suggestions on how I can build a result set that would return ASSET 001 AAA 1:00 (1 hour) ASSET 001 BBB 0:10 (10 minutes) ASSET 001 CCC 0:08 (8 minutes) ASSET 001 DDD {difference between

[SQL] Iterate and write a previous row to a temp table?

2007-07-03 Thread Bob Singleton
eague suggested a temp table, but I'm unsure how to iterate until I pass the startTime and then write the _previous_ and all subsequent rows to a temp table, stopping when I pass the endTime parameter. Any hints? Thanks! Bob Singleton ---(end of

Re: [SQL] Iterate and write a previous row to a temp table?

2007-07-06 Thread Bob Singleton
chester c young wrote: --- Bob Singleton <[EMAIL PROTECTED]> wrote: Revisiting a Time In Status query I received help on - I'm trying to narrow down a subset of data I return for analysis. Given a statusLog as entityId, statusId, timestamp that might look som

Re: [SQL] JOIN and aggregate problem

2009-02-20 Thread Bob Henkel
I might be missing something but does this solve your issue? CREATE TABLE t1(d INT,s INT, c INT); CREATE UNIQUE INDEX idx01_t1 ON t1 USING btree (d, s, c); INSERT INTO t1 (d, s, c) VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4); CREATE TABLE t2(d INT,s INT, c INT, x boolean); INSERT INTO t2(d, s, c, x

Re: [SQL] JOIN and aggregate problem

2009-02-20 Thread Bob Henkel
Scratch this one won't work for you. On Fri, Feb 20, 2009 at 1:03 PM, Bob Henkel wrote: > I might be missing something but does this solve your issue? > > CREATE TABLE t1(d INT,s INT, c INT); > > CREATE UNIQUE INDEX idx01_t1 > ON t1 USING btree (d, s, c); > > INSE

Re: [SQL] JOIN and aggregate problem

2009-02-20 Thread Bob Henkel
How about this? CREATE TABLE t1(d INT,s INT, c INT); CREATE UNIQUE INDEX idx01_t1 ON t1 USING btree (d, s, c); INSERT INTO t1 (d, s, c) VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5); CREATE TABLE t2(d INT,s INT, c INT, x boolean); INSERT INTO t2(d, s, c, x) VALUES (1,1,1,TRUE),(1,1,1,FALSE),

Re: [SQL] subquery question

2009-03-12 Thread Bob Henkel
EN id % 2 = 0 THEN value END) AS sum_even FROM xyz GROUP BY mydate; DATE;SUM_ODD;SUM_EVEN "2009-03-11";4;2 "2009-03-13";5;2 Check the plans generated to see if one query actually appears better than another. Bob On Thu, Mar 12, 2009 at 9:06 PM, Sebastian Böhm wrote: > Hi,