LassoScript Utility
Basics Browse Detail

-Distinct

Tag Link -Distinct Category Database
Type Command Source Available No
Support Preferred Version 6.0
Change Unchanged Data Source Lasso MySQL
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Description

Using the -Distinct keyword in an [Inline] causes a -Search or -Findall action to only output MySQL records that contain unique field values for a returned field. This is equivalent to performing a SELECT DISTINCT statement in SQL. Will output the first record containing a unique value only.

Syntax

[Inline: -Search, -Distinct, ...]

[Inline: -FindAll, -Distinct, ...]

Parameters

No Parameters Required.

Examples

To return only unique records for a specified field:

This example finds all records in the People table of the Contacts database, but only returns records with unique values in the Company field.

[Inline: -Findall, -Database='Contacts', -Table='People',
-ReturnField='Company', -Distinct]
[Records]
[Field:'Company']

[/Records]
[/Inline]

Blue World Communications