Java SQL Lookup Question

LabKey Support Forum (Inactive)
Java SQL Lookup Question jeckels  2016-03-14 22:18
Status: Closed
 
Hi Dennis,

Yes, you can use LabKey SQL's special lookup syntax to get the text value for these columns. In short, you can use "Column.LookupColumn" instead of doing a JOIN from "Column" to get the value of "LookupColumn" in the lookup table. Something like:

SELECT VisitDescription, PrimaryType.Description AS PrimaryTypeDescription, DerivativeType.description AS DerivativeTypeDescription, Count(DerivativeType.description) as Total FROM SpecimenDetail WHERE AtRepository = true group by VisitDescription, PrimaryType.description, DerivativeType.description

https://www.labkey.org/wiki/home/Documentation/page.view?name=lookups

Thanks,
Josh