add batch
remove batch
split batch
comment selection
show hidden batches
hide batch
highlight batch
db<>fiddle
Db2
Firebird
MariaDB
MySQL
Node.js
Oracle
Postgres
SQL Server
SQLite
TimescaleDB
YugabyteDB
Developer-C 11.1
3.0
4.0
10.2
10.3
10.4
10.5
10.6
10.7
10.8
10.9
5.5
5.6
5.7
8.0
18
11g Release 2
18c
21c
23c
8.4
9.3
9.4
9.5
9.6
10
11
12
13
14
15
16
2012
2014
2016
2017
2017 (Linux)
2019
2019 (Linux)
2022
3.8
3.16
3.27
3.39
2.11
2.14
2.6
2.8
2.18
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
Sakila
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
AdventureWorks
no sample DB
no sample DB
AdventureWorks
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
run
markdown
donate
feedback
about
By using db<>fiddle, you agree to license everything you submit by
Creative Commons CC0
.
CREATE TABLE XML_DATA ( info_TOL_ArticleList XML );
INSERT INTO XML_DATA (info_TOL_ArticleList) VALUES (N' <LIST> <ELEMENTS> <TOL_Article> <fields> <ArtDesc>Looprooster L1100xW1100x2mm Mesh 33,33x33,33</ArtDesc> <ArtNr>515021111</ArtNr> <BasePrice>153.7500</BasePrice> <Qty>3.0000000000</Qty> <Sort /> <Unit>st</Unit> </fields> </TOL_Article> <TOL_Article> <fields> <ArtDesc>FP Box</ArtDesc> <ArtNr>595224</ArtNr> <BasePrice>100.0000</BasePrice> <Qty>5.0000000000</Qty> <Sort /> <Unit>st</Unit> </fields> </TOL_Article> <TOL_Article> <fields> <ArtDesc>Cable assembly Fused</ArtDesc> <ArtNr>595225</ArtNr> <BasePrice>110.0000</BasePrice> <Qty>5.0000000000</Qty> <Sort /> <Unit>st</Unit> </fields> </TOL_Article> <TOL_Article> <fields> <ArtDesc>CP 01 Fans</ArtDesc> <ArtNr>209232</ArtNr> <BasePrice>4300.0000</BasePrice> <Qty>1.0000000000</Qty> <Sort /> <Unit>st</Unit> </fields> </TOL_Article> </ELEMENTS> </LIST> ');
1 rows affected
SELECT article.value('(ArtDesc/text())[1]', 'NVARCHAR(255)') AS ArtDesc, article.value('(Qty/text())[1]', 'DECIMAL(18,10)') AS Qty FROM XML_DATA xd CROSS APPLY xd.info_TOL_ArticleList.nodes(' /LIST/ELEMENTS/TOL_Article/fields [(ArtNr/text()) = "209232"] ') x1(article);
ArtDesc
Qty
CP 01 Fans
1.0000000000