官方文档
https://codeql.github.com/docs/ql-language-reference/queries/

查询指的是QL程序的输出,有两种查询方式:
1、使用select字句进行查询
2、使用query谓词进行查询

select字句

  1. import javascript
  2. from int x, int y
  3. where x = 3 and y in [0 .. 2]
  4. select x, y, x * y as product, "product: " + product
  5. order by product desc

image.png

query谓词

query谓词是一个非成员谓词,它返回谓词主体计算得出的所有数组

  1. query int getProduct(int x, int y) {
  2. x = 3 and
  3. y in [0 .. 2] and
  4. result = x * y
  5. }

image.png