[SQL] SQL function to validate money input

2003-10-15 Thread Zhao, Scott
Title: Message Hi All,   Is there a function available to validate if the input is a correct money format? For exapmle, "23.56" is a correct number but "23.567" is incorrect. I just like to do this in postgres level not in my application code.   Thanks   Scott  

Re: [SQL] Calc

2003-10-15 Thread Josh Berkus
There have been several discussions on running totals on this list over the last couple of weeks. See the archives for possible solutions. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 1: subscribe and un

Re: [SQL] indexing timestamp fields

2003-10-15 Thread Christopher Browne
teknokrat <[EMAIL PROTECTED]> writes: > Christopher Browne wrote: > >> teknokrat <[EMAIL PROTECTED]> writes: >> >>>Is it a good idea to index timestamp fields? what about date fields in >>>general? >> If you need to order by a timestamp, then it can be worthwhile. >> If that timestamp can be null,

Re: [SQL] Calc

2003-10-15 Thread Steve Crawford
On Wednesday 15 October 2003 12:59 pm, Muhyiddin A.M Hayat wrote: > Dear all, > > I have below table > > +-++-+ > > | id |db|cr | > > +-++-+ > > |1 |

[SQL] Calc

2003-10-15 Thread Muhyiddin A.M Hayat
Dear all,   I have below table   +-++-+  | id   |    db    |cr                          | +-++-+  |1 |        | 200  |  |2 | 100   

Re: [SQL] indexing timestamp fields

2003-10-15 Thread Christopher Browne
teknokrat <[EMAIL PROTECTED]> writes: > Is it a good idea to index timestamp fields? what about date fields in > general? If you need to order by a timestamp, then it can be worthwhile. If that timestamp can be null, and is rarely populated, then you might get a _big_ benefit from creating a part

Re: [SQL] Escaping the $1 parameter in stored procedures

2003-10-15 Thread robert
Found a solution: -- my_constraint(0) = turn off constraint -- my_constraint(1) = turn ON constraint CREATE OR REPLACE FUNCTION my_constraint(INTEGER) RETURNS VARCHAR AS ' DECLARE cmd VARCHAR; BEGIN IF $1 = 0 THEN

Re: [SQL] Sorting problem

2003-10-15 Thread Jean-Luc Lachance
You are obviously not using C locale. If you can't change it for some reason, you can use: select * from accounts order by int4( trim( acno, '#')); JLL "George A.J" wrote: > > hi all, > i am using postgres 7.3.2 .i am converitng a mssql database to > postgres. > now i am facing a strange proble

Re: [SQL] How can I produce the following desired result?

2003-10-15 Thread Jean-Luc Lachance
select distinct on( goodid) * from table order by goodid, storehistoryid desc, totalnum, operationdate; > aicean wrote: > > How can I produce the following desired result? > > goodidtotalnum operationdate storehistoryid >132 35.000 09-28-2003 66 >

Re: [SQL] How can I produce the following desired result?

2003-10-15 Thread greg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > How can I produce the following desired result? SELECT * FROM mytable JOIN (SELECT goodid, MAX(storehistoryid) AS storehistoryid FROM mytable GROUP by 1) AS a USING (goodid,storehistoryid); - -- Greg Sabino Mullane [EMAIL PROTECTED] PGP Key: 0x

Re: [SQL] about postgre SQL download

2003-10-15 Thread Richard Huxton
On Wednesday 15 October 2003 10:27, Illusiontechnologies wrote: > Sir, > We are using Windows 98,WindowsXP on our system. How we are going to > download postgre SQL for this window platform. Which would be the closest > mirror since we are from india. I don't recommend using Windows 98 to host a d

Re: [SQL] Create View

2003-10-15 Thread Richard Huxton
On Wednesday 15 October 2003 02:01, Muhyiddin A.M Hayat wrote: > > Table Billing: > > id trx_date trx_time depart payment_method > billing_amountamount_paid balance creator 1 10/09/2003 > 21:55:02 RestoVisa 13.