perlquestion
dimar
<p>Scenario:</p>
Assume a table called 'tvshow' with the following data:
<code>
### begin_: tvshow table
type ;; title ;; fname ;; lname
sitcom ;; simpsons ;; homer ;; simpson
sitcom ;; simpsons ;; ned ;; flanders
sitcom ;; flintstones ;; fred ;; flintstone
sitcom ;; flintstones ;; wilma ;; flintstone
sitcom ;; flintstones ;; barney ;; rubble
gameshow ;; price is right ;; bob ;; barker
gameshow ;; jeopardy ;; alex ;; trebek
</code>
<p>Question:</p>
Does there exist anything that will allow that data to be queried in a manner such as (or substantially similar to):
<code>
### begin_: query pseudo-code
TREE_SELECT type,title,fname,lname
FROM tvshow
WITH_LEVEL (1,'type' )
WITH_LEVEL (2,'title' )
WITH_LEVEL (3,'lname','fname' )
WHERE type = 'gameshow'
</code>
... producing the result ...
<code>
gameshow
price is right
barker,bob
jeopardy
trebek,alex
</code>
<p>Caveats:</p>
Assume the only important question is whether such a query syntax exists as either a published spec or (even better) runnable code somewhere.
<br /><br />
It is nice to have a perl-based solution that returns the results in structured (e.g., XML, perl data structure, YAML) format, but for now, mere confirmation of whether this exists somewhere (and if so, how is it implemented and what is it called) would be enough. The purpose is due-dilligence before re-inventing this particular wheel, assuming it *is* a wheel.
<br /><br />
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-347753">
<font size="-2">
=oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV
</font>
</div></div>