Re: [SQL] FOREIGN KEYs ... I think ...

2006-01-04 Thread Jim Johannsen
Marc Is the "assumption" that anytime there are comments the status changes? If I'm reading between the lines correctly, there could be a large number of comments before the status changes. So no need to change status until explicitly needed. If there is a specific "comment" th

Re: [SQL] How to get a count() where column < ''?

2005-12-04 Thread Jim Johannsen
Joost Kraaijeveld wrote: Hi Stephan, On Sun, 2005-12-04 at 13:33 -0800, Stephan Szabo wrote: SELECT COUNT(customers.objectid) FROM prototype.customers, prototype.addresses WHERE customers.contactaddress = addresses.objectid AND zipCode < '2716BN' ORDER By zipCode, houseNumber I

Re: [SQL] Numeric and CSV under 8.0.1 ?

2005-04-08 Thread Jim Johannsen
Stef: Why is iuserid numeric? Are you going to do any math on the field? If not, change it to varchar. In the long run you'll be happier. Stef wrote: Hello Everyone, Currently, here at work, I am doing the whole 'advocacy' part of postgreSQL. It's not really hard to do, as the other

Re: [SQL] Is it possible in PostgreSQL?

2004-01-18 Thread Jim Johannsen
This is what I use to flatten a table, the syntax may not be postgresql correct but you will get idea. SELECT a.name ,SUM (CASE WHEN EXTRACT(month from a.date) = 1 THEN a.quantity ELSE 0 END) AS '01'