How can I fetch distinct records from a query?

Does J1QL support the use of DISTINCT keyword (or something similar) to fetch distinct records? 

Answers

  • AaronO
    AaronO ✭✭✭
    J1Ql doesn't support the keyword DISTINCT, but aliasing the return statement can typically categorize results in the same way.  In this case find Unique aws_instance as ec2 return ec2.region, COUNT(ec2) should suite your need!
  • Thank you Aaron, this was helpful. Do you know how I can find the unique field for an asset? I can find multiple records for the same ec2 id when I search by the id field. Is there any document which explains the schema for every asset class/type in J1?

This Month's Leaders