[SQL] Group by minute

2006-09-22 Thread Ezequias Rodrigues da Rocha
Hil list,I have a query but my IDE (Delphi) does not accept to_char capability. Is there a way to reproduce the same query without using to_char function ?Here is my query:SELECT to_char(quando,'dd/MM/ HH24:MI'),count(id) FROM base.tentativaWHERE (SESSAO_ID = 15) GROUP BY

Re: [SQL] Group by minute

2006-09-22 Thread Niklas Johansson
On 22 sep 2006, at 15.52, Ezequias Rodrigues da Rocha wrote: I have a query but my IDE (Delphi) does not accept to_char capability. Is there a way to reproduce the same query without using to_char function ? ... GROUP BY to_char(quando,'dd/MM/ HH24:MI') To group by minute, you can

Re: [SQL] Group by minute

2006-09-22 Thread Mezei Zoltán
Ezequias Rodrigues da Rocha wrote: Hil list, I have a query but my IDE (Delphi) does not accept "to_char" capability. Is there a way to reproduce the same query without using to_char function ? Here is my query: SELECT  to_char(quando,'dd/MM/ HH24:MI'),count(id) FROM

Re: [SQL] Group by minute

2006-09-22 Thread Scott Marlowe
On Fri, 2006-09-22 at 10:52 -0300, Ezequias Rodrigues da Rocha wrote: Hil list, I have a query but my IDE (Delphi) does not accept to_char capability. Is there a way to reproduce the same query without using to_char function ? Here is my query: SELECT to_char(quando,'dd/MM/

Re: [SQL] nested select within a DISTINCT block

2006-09-22 Thread Bruno Wolff III
On Thu, Sep 14, 2006 at 05:02:25 -0700, zqzuk [EMAIL PROTECTED] wrote: Hi, here i have a problem with this task... I have a table cancellation which stores cancelled bookings and details of charges etc and a table bookings which stores details of bookings, for example:

[SQL] How to autoincrement a primary key...

2006-09-22 Thread Doug Hyde
I am sure this is simple, but I don't get it. I am new to PGSQL, coming from MySQL - in mysql, you can autoincrement the primary key; in postgre, I am not sure how to do this. I have read the documentation, and tried nextval as the default - I have searched for the datatype SERIAL, but I am using

Re: [SQL] How to autoincrement a primary key...

2006-09-22 Thread Richard Broersma Jr
I am sure this is simple, but I don't get it. I am new to PGSQL, coming from MySQL - in mysql, you can autoincrement the primary key; in postgre, I am not sure how to do this. I have read the documentation, and tried nextval as the default - I have searched for the datatype SERIAL, but I am

Re: [SQL] How to autoincrement a primary key...

2006-09-22 Thread Andrew Chilton
On 23/09/06, Richard Broersma Jr [EMAIL PROTECTED] wrote: Is just shorthand notation for: CREATE SEQUENCE foo START 1; CREATE TABLE bar (id integer PRIMARY KEY DEFAULT nextval('bar')); Doug, just a slight typo correction in that second line Richard gave you (bar should be foo), it should read