box.out
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:4k
- QUERY: CREATE TABLE BOX_TBL (f1 box);
- QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(2.0,2.0,0.0,0.0)');
- QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(1.0,1.0,3.0,3.0)');
- QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(2.5, 2.5, 2.5,3.5)');
- QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(3.0, 3.0,3.0,3.0)');
- QUERY: INSERT INTO BOX_TBL (f1) VALUES ('(2.3, 4.5)');
- ERROR: Bad box external representation '(2.3, 4.5)'
- QUERY: INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad');
- ERROR: Bad box external representation 'asdfasdf(ad'
- QUERY: SELECT '' AS four, BOX_TBL.*;
- four|f1
- ----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- (4 rows)
- QUERY: SELECT '' AS four, b.*, box_area(b.f1) as barea
- FROM BOX_TBL b;
- four|f1 |barea
- ----+-------------------+-----
- |(2,2),(0,0) | 4
- |(3,3),(1,1) | 4
- |(2.5,3.5),(2.5,2.5)| 0
- |(3,3),(3,3) | 0
- (4 rows)
- QUERY: SELECT '' AS three, b.f1
- FROM BOX_TBL b
- WHERE b.f1 && '(2.5,2.5,1.0,1.0)'::box;
- three|f1
- -----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- (3 rows)
- QUERY: SELECT '' AS two, b1.*
- FROM BOX_TBL b1
- WHERE b1.f1 &< '(2.0,2.0,2.5,2.5)'::box;
- two|f1
- ---+-------------------
- |(2,2),(0,0)
- |(2.5,3.5),(2.5,2.5)
- (2 rows)
- QUERY: SELECT '' AS two, b1.*
- FROM BOX_TBL b1
- WHERE b1.f1 &> '(2.0,2.0,2.5,2.5)'::box;
- two|f1
- ---+-------------------
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- (2 rows)
- QUERY: SELECT '' AS two, b.f1
- FROM BOX_TBL b
- WHERE b.f1 << '(3.0,3.0,5.0,5.0)'::box;
- two|f1
- ---+-------------------
- |(2,2),(0,0)
- |(2.5,3.5),(2.5,2.5)
- (2 rows)
- QUERY: SELECT '' AS four, b.f1
- FROM BOX_TBL b
- WHERE b.f1 <= '(3.0,3.0,5.0,5.0)'::box;
- four|f1
- ----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- (4 rows)
- QUERY: SELECT '' AS two, b.f1
- FROM BOX_TBL b
- WHERE b.f1 < '(3.0,3.0,5.0,5.0)'::box;
- two|f1
- ---+-------------------
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- (2 rows)
- QUERY: SELECT '' AS two, b.f1
- FROM BOX_TBL b
- WHERE b.f1 = '(3.0,3.0,5.0,5.0)'::box;
- two|f1
- ---+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
- (2 rows)
- QUERY: SELECT '' AS two, b.f1
- FROM BOX_TBL b
- WHERE b.f1 > '(3.5,3.0,4.5,3.0)'::box;
- two|f1
- ---+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
- (2 rows)
- QUERY: SELECT '' AS four, b.f1
- FROM BOX_TBL b
- WHERE b.f1 >= '(3.5,3.0,4.5,3.0)'::box;
- four|f1
- ----+-------------------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(2.5,3.5),(2.5,2.5)
- |(3,3),(3,3)
- (4 rows)
- QUERY: SELECT '' AS two, b.f1
- FROM BOX_TBL b
- WHERE '(3.0,3.0,5.0,5.0)'::box >> b.f1;
- two|f1
- ---+-------------------
- |(2,2),(0,0)
- |(2.5,3.5),(2.5,2.5)
- (2 rows)
- QUERY: SELECT '' AS three, b.f1
- FROM BOX_TBL b
- WHERE b.f1 @ '(0,0,3,3)'::box;
- three|f1
- -----+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(3,3),(3,3)
- (3 rows)
- QUERY: SELECT '' AS three, b.f1
- FROM BOX_TBL b
- WHERE '(0,0,3,3)'::box ~ b.f1;
- three|f1
- -----+-----------
- |(2,2),(0,0)
- |(3,3),(1,1)
- |(3,3),(3,3)
- (3 rows)
- QUERY: SELECT '' AS one, b.f1
- FROM BOX_TBL b
- WHERE '(1,1,3,3)'::box ~= b.f1;
- one|f1
- ---+-----------
- |(3,3),(1,1)
- (1 row)
- QUERY: SELECT '' AS four, @@(b1.f1) AS p
- FROM BOX_TBL b1;
- four|p
- ----+-------
- |(1,1)
- |(2,2)
- |(2.5,3)
- |(3,3)
- (4 rows)
- QUERY: SELECT '' AS one, b1.*, b2.*
- FROM BOX_TBL b1, BOX_TBL b2
- WHERE b1.f1 ~ b2.f1 and not b1.f1 ~= b2.f1;
- one|f1 |f1
- ---+-----------+-----------
- |(3,3),(1,1)|(3,3),(3,3)
- (1 row)
- QUERY: SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL;
- four|height|width
- ----+------+-----
- | 2| 2
- | 2| 2
- | 1| 0
- | 0| 0
- (4 rows)