Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
1ee065bb
Commit
1ee065bb
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-01-23 15:41:48 by cmiachon] added CQLp
Original author: cmiachon Date: 2004-01-23 15:41:48+00:00
parent
66ce486d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/cql/R/q9.cd
View file @
1ee065bb
...
...
@@ -62,7 +62,7 @@ let fun get-year-from-date(Date -> Year)
|[y::(_ _ _ _) _*] -> y
;;
(* In CQLx based on the XQUERY's query)
let end_dates = [items]/Item_tuple/End_date
in <result>
...
...
@@ -78,6 +78,21 @@ in <result>
)in [x]
;;
(* In CQLp *)
let months = select months
from <items>[i::Item_tuple*] in [items],
<item_tuple>[ _* e::End_date ;_ ] in i,
<end_date>['1999-' months::(_ _) '-'_*] in e
in <result>
select <monthly_result>[
<month>m
<item_count>(count(select m2
from m2 in months
where m=m2))]
from m in order(distinct_values(months))
;;
(* in XQUERY
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment