-- Create a table with a Pnt column
create table tst_Pnt
(
id integer,
value Pnt
);
-- Add a row to the table
insert into tst_Pnt( id, value )
values ( 0, '0 0');
-- Add another row
insert into tst_Pnt( id, value )
values ( 1, '0 1' );
-- Add a row with a negative element
insert into tst_Pnt( id, value )
values ( 2, '0 -1' );
-- Add a row with a very small element
insert into tst_Pnt( id, value )
values ( 3, '+5.678E-100 0' );
-- Add a row with a very precise element
insert into tst_Pnt( id, value )
values (4, '0 1234567890.12345678');
-- Make sure the table contains the data you inserted
select * from tst_Pnt;
-- Find the distance of each point from the origin
select id, Distance('0 0', value) from tst_Pnt;
-- Create a table with a Circ column
create table tst_Circ
(
id integer,
value Circ
);
-- Add some rows
insert into tst_Circ(id,value)
values (0, '0 0 1.0');
insert into tst_Circ(id,value)
values (1, '1 0 0.9');
insert into tst_Circ(id,value)
values (2, '-1 0 1.5');
-- Make sure the table contains the data you inserted
select * from tst_Circ;
-- Find which circles contain the origin
select id, Contains(value, '0 0') from tst_Circ order by id;