Re: [SQL] sorting months according to fiscal year

2011-08-22 Thread Gavin Flower
On 23/08/11 01:27, Enzen user wrote: Hi I have to rearrange the months according to the fiscal year i.e from April to march and use the same in the order by clause of a query. I have written the following postgresql function for the same, but to_number is returning an error. Can you please tell

Re: [SQL] Confused about writing this stored procedure/method.

2011-08-22 Thread Pavel Stehule
Hello 2011/8/22 JavaNoobie : > Hi All, > I'm trying to write a stored procedure /function to re-order a set of > calendar months.I have a set of calendar months stored from January to > December in my tables. And as of now when I do order by on this column  , > the data is ordered alphabetically ,

[SQL] Confused about writing this stored procedure/method.

2011-08-22 Thread JavaNoobie
Hi All, I'm trying to write a stored procedure /function to re-order a set of calendar months.I have a set of calendar months stored from January to December in my tables. And as of now when I do order by on this column , the data is ordered alphabetically , starting April, august etc. and so on

Re: [SQL] exclusion constraint for ranges of IP

2011-08-22 Thread Harald Fuchs
In article <1343d11c-6f58-4653-8ea8-837c01e61...@unicell.co.il>, Herouth Maoz writes: > On 22/08/2011, at 01:19, Harald Fuchs wrote: >> In article , >> Herouth Maoz writes: >> >>> Hi, >>> I'm designing a new database. One of the table contains allowed IP ranges >>> for a customer (Fields: cus

Re: [SQL] sorting months according to fiscal year

2011-08-22 Thread Pavel Stehule
Hello 2011/8/22 Enzen user : > Hi > I have to  rearrange the months according to the fiscal year i.e from April > to march and use the same in the order by clause of a query. > I have written the following postgresql function for the same, but to_number > is returning an error. > Can you please te

[SQL] sorting months according to fiscal year

2011-08-22 Thread Enzen user
Hi I have to rearrange the months according to the fiscal year i.e from April to march and use the same in the order by clause of a query. I have written the following postgresql function for the same, but to_number is returning an error. Can you please tell me where i'm going wrong? Instead of t

Re: [SQL] exclusion constraint for ranges of IP

2011-08-22 Thread Misa Simic
Hi Herouth, I think you are right about exclusion... If you are getting 'string' I think then command would be: INSERT INTO customer_ip_range(cutomer_id, ip4r) VALUES('customeridstring', ip4r('iprangestring')) Kind Regards, Misa 2011/8/22 Herouth Maoz > > On 22/08/2011, at 01:19, Harald Fuc

Re: [SQL] exclusion constraint for ranges of IP

2011-08-22 Thread Jasen Betts
On 2011-08-21, Herouth Maoz wrote: > Hi, > > I'm designing a new database. One of the table contains allowed IP ranges for > a customer (Fields: customer_id, from_ip, to_ip) which is intended to check - > if an incoming connection's originating IP number falls within the range, it > is identif

Re: [SQL] exclusion constraint for ranges of IP

2011-08-22 Thread Simone Sanfratello
Hi, you can do the identification of customer by ip in many ways. IMHO, first of all, you have to put the allowed IPs into your table. The simpler way is to write all IPs allowed, of course. The simpler way to do range check is to have 2 columns in table, IP-range-starts and IP-range-ends, so the S

Re: [SQL] exclusion constraint for ranges of IP

2011-08-22 Thread Herouth Maoz
On 22/08/2011, at 01:19, Harald Fuchs wrote: > In article , > Herouth Maoz writes: > >> Hi, >> I'm designing a new database. One of the table contains allowed IP ranges >> for a customer (Fields: customer_id, from_ip, to_ip) which is intended to >> check - if an incoming connection's origina