Template:TNG showdata/get crew test: Difference between revisions

From 'City of Adelaide' History and Genealogy Site
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{#get_db_data:
<!--{{#get_db_data:
db=tng_db
db=tng_db
|from= tng_people <!--RIGHT--> JOIN wk1_datatable2_data ON wk1_datatable2_data.dtd_04 = (SELECT MIN(dtd_04) FROM wk1_datatable2_data WHERE dtd_04 = tng_people.personID)
|from= tng_people OUTER JOIN wk1_datatable2_data ON tng_people.personID = wk1_datatable2_data.dtd_04
<!-- |where wk1_datatable2_data.dtd_04 in (SELECT DISTINCT wk1_datatable2_data.dtd_04 FROM wk1_datatable2_data) -->
<!-- |where wk1_datatable2_data.dtd_04 in (SELECT DISTINCT wk1_datatable2_data.dtd_04 FROM wk1_datatable2_data) -->
<!-- |limit=50 -->
<!-- |limit=50 -->
|order by=tng_people.personID ASC <!--ID-->
|order by=tng_people.personID ASC <!--ID-->
|data=GROUP BY wk1_datatable2_data.dtd_04 personID=tng_people.personID,tnglastname=tng_people.lastname,tngfirstname=tng_people.firstname,crewlastname=wk1_datatable2_data.dtd_07,crewfirstname=wk1_datatable2_data.dtd_08}}
|data= GROUP BY tng_people.personID <!-- wk1_datatable2_data.dtd_04 --> personID=tng_people.personID,tnglastname=tng_people.lastname,tngfirstname=tng_people.firstname,crewtngid=MAX(wk1_datatable2_data.dtd_04)crewlastname=wk1_datatable2_data.dtd_07,crewfirstname=wk1_datatable2_data.dtd_08}}
<noinclude>
<noinclude>
[[Category:Data retrieval templates]]
[[Category:Data retrieval templates]]
Line 11: Line 11:
</noinclude>
</noinclude>
<!--
<!--
SELECT T1.ID, T1.myName, MAX(T2.myDate) mydate
FROM Table1 T1
LEFT OUTER JOIN Table2 T2 ON T1.ID = T2.ID
GROUP BY t1.ID, T1.myName
ORDER BY T1.ID, T2.myDate DESC


SELECT  Orders.OrderNumber, LineItems.Quantity, LineItems.Description
SELECT  Orders.OrderNumber, LineItems.Quantity, LineItems.Description

Revision as of 14:30, 22 September 2014

|order by=tng_people.personID ASC |data= GROUP BY tng_people.personID personID=tng_people.personID,tnglastname=tng_people.lastname,tngfirstname=tng_people.firstname,crewtngid=MAX(wk1_datatable2_data.dtd_04)crewlastname=wk1_datatable2_data.dtd_07,crewfirstname=wk1_datatable2_data.dtd_08}} {{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}