Re: [SQL] custom serial number

2008-11-19 Thread mahmoud ewiwi
Thank you very much, it works fine with me , but how can i restart the sequence at the start of each month, or should i do it programatically? Mahmoud Al-Ewiwi Al-Mahawer Hebron- Palestine --- On Wed, 11/19/08, A. Kretschmer <[EMAIL PROTECTED]> wrote: > From: A. Kretschmer <[EMAIL PROTECTED]

[SQL] Query to retrieve all indexed columns

2008-11-19 Thread Bart van Houdt
Hi, I am working on a query to retrieve all indexed columns and came up with the following query: select pgc.relname as indexname ,pgc2.relname as tablename ,pga.attname as columnname ,pga.attnum as columnnumber ,replace(pgi.indkey::text, ' ', ',') as columnindex

Re: [SQL] custom serial number

2008-11-19 Thread A. Kretschmer
am Wed, dem 19.11.2008, um 0:52:07 -0800 mailte mahmoud ewiwi folgendes: > Thank you very much, it works fine with me , but how can i restart the > sequence at the start of each month, or should i do it programatically? For instance, check if a record for the actual month are in the table. If n

Re: [SQL] Left Join Question

2008-11-19 Thread Ryan Wells
Thanks for the feedback, everyone. > > FROM tasks > > LEFT JOIN clients ON tasks.ClientId = clients.ClientId > > LEFT JOIN iteminfo ON tasks.Id = iteminfo.ItemId > >LEFT JOIN changelog ON tasks.Id = changelog.ItemId > > LEFT JOIN ticklers ON tasks.Id = ticklers.RelatedId > > WHERE

[SQL] VACUUM cannot be executed from multi-command string

2008-11-19 Thread Sabin Coanda
Hi there, I upgrade "PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)" to "PostgreSQL 8.3.5, compiled by Visual C++ build 1400". I found the new Postgres version doesn't allowed to run a script file which contains multiline statements, which was working at

Re: [SQL] VACUUM cannot be executed from multi-command string

2008-11-19 Thread Richard Huxton
Sabin Coanda wrote: > Hi there, > > I upgrade "PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe > (GCC) 3.4.2 (mingw-special)" to "PostgreSQL 8.3.5, compiled by Visual C++ > build 1400". > > I found the new Postgres version doesn't allowed to run a script file which > contains multil

Re: [SQL] Query to retrieve all indexed columns

2008-11-19 Thread Tom Lane
"Bart van Houdt" <[EMAIL PROTECTED]> writes: > I am working on a query to retrieve all indexed columns and came up with > the following query: > ... > Tis query works for single column indexes, but with multiple column > indexes I get incorrect results... I'm having a hard time figuring out > how t

[SQL] date range query help

2008-11-19 Thread novice
Hi, We have two tables. select * from mobile_custodian; custodian_id | user_id | issue_date | return_date | mobile_no --+-++-+- 4 | Ben | 2008-10-11 | 2008-10-13 | 09455225998 5 |Josh | 2008-10-15 |

Re: [SQL] [GENERAL] date range query help

2008-11-19 Thread novice
2008/11/20 Adam Rich <[EMAIL PROTECTED]>: >> Now user Ben has passed his mobile to user Josh and we issued Josh his >> mobile on 2008-10-15. >> >> 1. Is it possible for me to write a query that will have the fields >> >> call.call_id, >> call.datetime, >> mobile_custodian.user_id, >> call.mobile_no

Re: [SQL] [GENERAL] date range query help

2008-11-19 Thread novice
2008/11/20 brian <[EMAIL PROTECTED]>: > novice wrote: >> >> 2008/11/20 Adam Rich <[EMAIL PROTECTED]>: >>> >>> select call.call_id, >>> call.datetime, >>> mobile_custodian.user_id, >>> call.mobile_no >>> call.charge >>> from call, mobile_custodian >>> where call.mobile_no = mobile_custodian.mobi

Re: [SQL] [GENERAL] date range query help

2008-11-19 Thread Rodrigo E. De León Plicet
On Wed, Nov 19, 2008 at 10:03 PM, novice <[EMAIL PROTECTED]> wrote: > sorry I get nothing :( Of course not. None of the dates you gave in the example overlap. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pg

Re: [SQL] [GENERAL] date range query help

2008-11-19 Thread novice
2008/11/20 Rodrigo E. De León Plicet <[EMAIL PROTECTED]>: > On Wed, Nov 19, 2008 at 10:03 PM, novice <[EMAIL PROTECTED]> wrote: >> sorry I get nothing :( > > Of course not. None of the dates you gave in the example overlap. > But it should still have the 1st entry with the name Ben? Am I missing