QML Example - Nested query of Mycolological Database


Look at the QML Source for this page Select one or more initials for Author selection (since there are really too many authors to display the full list):
Select one or more authors (select lots of them - to see what this demo does, you want to be sure you get at least one who has more than one publication in the database):


SQL queries will generally return one record per distinct entry - which means that if you queried a bibliographic database in which authors had multiple publications, you would typically see one line per publication, with the author repeated on each line. A bulleted list of entries for each author is probably more readable, but difficult to create.

In this page, we've generated the list by sending a nested database query for each author to get the appropriate publications:

	<ul>
	<qml_output sql="select distinct Authors ...">
	<li>Author(s): <i>$Authors</i> 
	<ul>
	<qml_output sql="select distinct Title ... where Authors = '$Authors'">
	<li>$Title
	</qml_output>
	</ul>
	</qml_output>
	</ul>
Not the most efficient query, perhaps, but it gives us the output we want.



Written in QML
Software designed for Biologists