Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?

1999-04-28 Thread Bob Dusek
Hey there... > SELECT customer_username, COUNT(customer_username) FROM customerdata GROUP BY >customer_username; > The above query, in effect, does the same thing that: SELECT DISTINCT(customer_username) from customerdata does. In order to get the total number of distinct customer_username

Re: [GENERAL] Query is too long

1999-01-15 Thread Bob Dusek
Sorry, I should have been more clear: > One way to execute .sql scripts in your database is this: > > psql -e dbname < script.sql That should be done from the command line. > That is how we recreate our databases from a dump file. > > "psql -ef script.sql dbname" seems to have the same pro

Re: [GENERAL] Query is too long

1999-01-15 Thread Bob Dusek
Hey there, One way to execute .sql scripts in your database is this: psql -e dbname < script.sql That is how we recreate our databases from a dump file. "psql -ef script.sql dbname" seems to have the same problem you were having with the \i command: query buffer max length of 2 exceeded

Re: [GENERAL] Money

1998-12-13 Thread Bob Dusek
Hey there, I had some similar problems recently, try this select someid, somemoneyfield * 2::float as product from table; You cannot multiply money * money, apparently. But, money * float seems to work fine. Same goes with division: select someid, somemoneyfield / 2::float as quotient from t

[GENERAL] Dividing Money

1998-12-01 Thread Bob Dusek
Hey all, I have been trying to figure out how to divide a data field of type 'money'. And, I've been unsuccesful. So, I have a couple of questions to ask. When I query my database, using 'select price from item_money;', postgres returns just what I asked for (the first seven rows