findSingleAttributeList (retrieve the value of a single column for all instances of a model that match the query)

Execute the query returning a list of values for a single property. If you want to retrieve the value from a single property of a specific model, you can use the findSingleAttributeList method. You need to use the select() method to select which column you want to retrieve the value

Example 1:

List<String> names = DB.find(Customer.class)
    .select("name")
    .orderBy().asc("name")
    .findSingleAttributeList();

Example 2:

List<String> names = DB.find(Customer.class)
    .setDistinct(true)
    .select("name")
    .where().eq("status", Customer.Status.NEW)
    .orderBy().asc("name")
    .setMaxRows(100)
    .findSingleAttributeList();

If you use more than one value in the select clause (like select("name,email"), only the first will be returned.