sedna進行xquery查詢

2021-07-03 15:39:40 字數 2336 閱讀 8379

有乙個檔案book.xml:

the call of wild

jack london

32.5$

2015-7-6

wuthering heights

emily bronte

40$2015-7-5

建立books資料庫:

[root@localhost xuzhina]#se_cdb books

creating a database (this can take a few minutes)...

the database 'books' has been created successfully

啟動它:

[root@localhost xuzhina]#se_sm books

starting database recovery or hot-backup restoration...

database is in consistent state. starting...

sm has been started in the background mode

建立乙個collection叫novel:

[root@localhost xuzhina]#se_term -query "create collection 'novel'" books

update is executed successfully

載入進去:

[root@localhost xuzhina]#se_term -query "load 'book.xml' 'book' 'novel'" books

bulk load succeeded

查詢整個檔案:

[root@localhost xuzhina]#se_term -query "for \$p in collection('novel')/books return \$p" book

sthe call of wild

jack london

32.5$

2015-7-6

wuthering heights

emily bronte

40$2015-7-5

查詢book:

[root@localhost xuzhina]#se_term -query "for \$p in collection('novel')/books/book return \$p"

books

the call of wild

jack london

32.5$

2015-7-6

wuthering heights

emily bronte

40$2015-7-5

查詢某個書名的book:

[root@localhost xuzhina]#se_term -query "for \$p in collection('novel')/books/book[name='the

call of wild'] return \$p" books

the call of wild

jack london

32.5$

2015-7-6

查詢第2本書(記住它的索引是從1開始的):

[root@localhost xuzhina]#se_term -query "for \$p in collection('novel')/books/book[2] return

\$p" books

wuthering heights

emily bronte

40$2015-7-5

查詢某個書的書名包括某個詞語,比如call:

[root@localhost xuzhina]#se_term -query "for \$p in collection('novel')/books/book[contains(n

ame, 'call')] return \$p" books

the call of wild

jack london

32.5$

2015-7-6

sedna進行xquery查詢

有乙個檔案book.xml the call of wild jack london 32.5 2015 7 6 wuthering heights emily bronte 40 2015 7 5 建立books資料庫 root localhost xuzhina se cdb books cre...

SQL SERVER 進行遞迴查詢

有如下資料表 假如我們要查詢id為003的資料的所有子節點我們可以使用cte 遞迴查詢完成.if object id tb n is notnull drop table tb create table tb id varchar 3 pid varchar 3 name varchar 10 in...

如何進行空間查詢

如何進行空間查詢 要點 通過rubberpolygon類來實現介面irubberband介面物件,用irubberband.tracknew方法在圖層上畫出polygon,然後定義igeometry獲得該polygon,建立ispatialfilter介面物件實現過濾功能,通過ilayer介面例項獲...