SELECT 句

ADQL イベントクエリは、1 つ以上の引数を受け取ることができる SELECT 句から始まります。

SELECT* | {[DISTINCT] field_expression [ASalias] [, field_expression [ASalias]]...}

  • SELECT 句内の単一のアスタリスク * で、イベントごとにフィールドのリストを返します。
  • 各イベントの特定のフィールドを返すには、フィールドのカンマ区切りリストを指定します。必要に応じて、AS コンストラクトを使用して、各 field_expression にエイリアスを付けることができます。
  • 指定したフィールド値の一意の組み合わせを返すには、 DISTINCT 修飾子を使用します。制限が指定されていない場合は、上位 10 件の結果が返されます。「LIMIT 句」を参照してください。DISTINCT は、以下のようなワイルドカード SELECT クエリには適用できません。

    SELECT DISTINCT *
  • 文字列値は、一重引用符または二重引用符で囲む必要があります('hello'、"hello" など)。

field_expression にはいくつかの形式があります。「ADQL 式」を参照してください。

Query Examples with SELECT Clause

QueryResult
SELECT count (transactionName) FROM transactions WHERE application='yourAppName'Returns a count of business transactions for the specified application.
SELECT * FROM logs WHERE sourceType='yourLogFile' AND message LIKE 'GET'Returns log events containing a specified keyword.
SELECT * FROM transactions WHERE application='yourAppName' AND transactionName='yourBTName'Returns all fields for business transactions in the specified application matching the specified transaction name.
SELECT DISTINCT transactionName FROM transactions WHERE application='yourAppName'Returns a list of unique transaction names from the specified application.
SELECT customerName AS "First And Last Name",age AS "Years Old", ...Returns the specified fields relabeled as specified in the query statement. In this query,customerNameandageare user-defined fields.