> select ROUND(0.5) ; returns 0
> select ROUND(1.5) ; returns 2;
> select ROUND(2.5) ; returns 2;
> select ROUND(3.5) ; returns 4;so on .
> I'm sure you would have figured out what's happening !!! Why ??
> How do I get to approximate any number x.5 as x+1 ??
Looks like a bug to me:
test=# se
"Saurabh Mittal" <[EMAIL PROTECTED]> writes:
> select ROUND(0.5) ; returns 0
> select ROUND(1.5) ; returns 2;
> select ROUND(2.5) ; returns 2;
> select ROUND(3.5) ; returns 4;so on .=20
> I'm sure you would have figured out what's happening !!! Why ??
Because the IEEE float math standard says
"Josh Berkus" <[EMAIL PROTECTED]> writes:
> DECLARE
> v_field1 mytable.field1%type
> is supported internal to a PL/pgSQL function, but
> CREATE FUNCTION test1(int) RETURNS mytable.filed1%type
> is not. This is because the %type declaration is supported in PL/pgSQL,
> but not in Postgres SQL.
It
Hi,
select ROUND(0.5) ; returns 0
select ROUND(1.5) ; returns 2;
select ROUND(2.5) ; returns 2;
select ROUND(3.5) ; returns 4;so on .
I'm sure you would have figured out what's
happening !!! Why ??
How do I get to approximate any number
x.5 as x+1 ??
Saurabh
Mourad,
> > I have an other question about the use of %type and alias in
> PL/SQL. So the
> > excution of functions containing varibales of type
> maytable.field1%type
> > prompts parser errors.
> > error on the creation of the function :
> > create function test (int) returns maytable.field1%ty
On Fri, Oct 05, 2001 at 03:37:14PM +0200, Mourad EL HADJ MIMOUNE wrote:
> Hi,
> I'm looking for PL/SQL programmer tool. I wanted to use SQL-Programmer but
> it
> doesn't support Postgres data base.
> Please can sommeone suggest me an other tool wich can replace this one or
> explaine me how w
On Mon, 8 Oct 2001, Janning Vygen wrote:
> Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo:
> > On Mon, 8 Oct 2001, Janning Vygen wrote:
> >
> > > but how do i reach my goal. It should not be allowed to have a
> > > person without any address??
> >
> > Hmm, do you always have at least on
Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo:
> On Mon, 8 Oct 2001, Janning Vygen wrote:
>
> > but how do i reach my goal. It should not be allowed to have a
> > person without any address??
>
> Hmm, do you always have at least one known address at the time
> you're inserting the perso
On Mon, 8 Oct 2001, Janning Vygen wrote:
> Am Freitag, 5. Oktober 2001 14:30 schrieb Morgan Curley:
> > just get rid of the serial_id in person2adress -- there is no
> > reason for it. Make the pk of that table a composite --> person_id,
> > address_id <-- that way you have added some additional
> Bruce Momjian wrote:
> >
> > We can handle the temp views thing two ways, either allow views to map
> > to temp tables by name, or allow temp views to map to temp tables that
> > exist at creation time and drop the views on session exit. The original
> > poster clearly wanted the first behavio
> Hi all,
>
> I need to implement "Find all hospitals in a 5 mile radius". Say I have
all
> the coordinates on them stored in a table with the fields longitude and
> latitude. Has anybody some sample code for that?
>
> Best regards,
> Chris
>
Here's a plpgsql function that will do what you need.
Have you tried already
SELECT DISTINCT FROM ;
If you receive an error message like
Unable to identify an ordering operator ...
Refer to 'Server Programming' section Extending SQL: Operators
to learn about creating your own operators for array comparison
Or search the mailing-list for simil
Better still, check out PostGIS at http://postgis.refractions.net/
Cheers,
Colin
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Here is some perl code which does what you want.
- Original Message -
From: "Chris Ruprecht" <[EMAIL PROTECTED]>
To: "pgsql" <[EMAIL PROTECTED]>
Sent: Monday, October 08, 2001 8:58 AM
Subject: [SQL] Search by longitude/latitude
> Hi all,
>
> I need to implement "Find all hospitals in a
To help you understand SQL I should point out that your version would
work (assuming only 1 school per person) if you just left the friends
out of the FROMs for the sub-selects:-
select frienda, friendb from friends where
(select schools.school from schools as schoolsa where friends.frienda =
sc
Hi all,
I need to implement "Find all hospitals in a 5 mile radius". Say I have all
the coordinates on them stored in a table with the fields longitude and
latitude. Has anybody some sample code for that?
Best regards,
Chris
_
Do You Yah
Hi,
It's me again. I have been able to solve most of the porting problems
from mysql to pgsql. But I have got struck in one place. I have a
problem where PEAR's associative array doesn't recognise the mix case
letters.
eg . I issue a query through PEAR db and get results using fetchRow of
PEAR.
Bruce Momjian wrote:
>
> We can handle the temp views thing two ways, either allow views to map
> to temp tables by name, or allow temp views to map to temp tables that
> exist at creation time and drop the views on session exit. The original
> poster clearly wanted the first behavior, but I agr
OK the problem is with ZEOS Components
Michel BELLON
LCIE - Informatique appliquée
33 (0)1 40 95 60 35
> -Message d'origine-
> De: Christopher Sawtell [SMTP:[EMAIL PROTECTED]]
> Date: lundi 8 octobre 2001 12:39
> À:BELLON Michel; guard; [EMAIL PROTECTED]
> Objet:Re: [SQL] s
On Mon, 08 Oct 2001 22:31, BELLON Michel wrote:
Works ok for me.
chris=# select -5/2.0;
?column?
--
-2.5
(1 row)
chris=# select version();
version
-
PostgreSQL 7.1.1 on i586-pc-linux-gnu, compi
The good select is
SELECT 5./2.
BUT
select -5./2.
+--+
| ?column? |
+--+
| 2.5 | not -2.5
+--+
Michel BELLON
LCIE - Informatique appliquée
33 (0)1 40 95 60 35
> -Message d'origine-
> De: guard [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 3 octo
I'm having some experience with C embedded SQL
and what I can see at first sight is
1) DECLARE CURSOR statement - missing colon:
EXEC SQL DECLARE C77 CURSOR FOR select datname from pg_user,pg_database
where usename= :user and datdba= :usesysid;
2) before OPEN you have to declare and set the wh
hello all,
how can we get unique elements from an array(of any type)?
Regards,
Bhuvaneswar.
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Am Freitag, 5. Oktober 2001 14:30 schrieb Morgan Curley:
> just get rid of the serial_id in person2adress -- there is no
> reason for it. Make the pk of that table a composite --> person_id,
> address_id <-- that way you have added some additional integrity to
> your structure. Only one record ca
24 matches
Mail list logo