You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
SQL function
Phone number function
Copy page
Download PDF
Phone number function
This article introduces the syntax of phone number functions supported by TLS and usage examples for common scenarios.​
Function list​
Notice​
  • In TLS analysis statements (SQL statements), string values must be enclosed in single quotes (''). Identifiers, such as field names or column names, are either not enclosed in quotes or are enclosed in double quotes (""). For example, 'time' represents a string, time or "time" represents a field name or column name.​
  • The phone number function is used to query information about mainland China phone numbers, such as location, carrier, and other details.​
​
Function name​
Syntax​
Notice​
MOBILE_CARRIER(KEY)​
Query the operator of the phone number.​
MOBILE_CITY(KEY)​
Query the city to which the phone number belongs.​
MOBILE_PROVINCE(KEY)​
Query the province associated with the phone number.​
​
MOBILE_CARRIER function​
The MOBILE_CARRIER function is used to query the carrier of a phone number.​
Function syntax​
  • Syntax format​
  • ​
    MOBILE_CARRIER(KEY)​
    ​
  • Parameters description​
  • ​
    Parameter​
    Notice​
    KEY​
    Log fields and expressions whose values are phone numbers in numeric format.​
    The data type of the value must be Bigint.​
    ​
  • Description of return value​
  • The return value is of the Varchar type.​
Function examples​
  • Scenarios​
  • mobile field value is a phone number, and you can use the MOBILE_CARRIER function to query which carrier these phone numbers belong to.​
  • Query statements and analysis statements​
  • ​
    * | SELECT MOBILE_CARRIER(mobile)​
    ​
MOBILE_CITY function​
The MOBILE_CITY function is used to analyze the city associated with a phone number.​
Functionsyntax​
  • Syntax format​
  • ​
    MOBILE_CITY(KEY)​
    ​
  • Parameters description​
  • ​
    Parameter​
    Notice​
    KEY​
    Log fields and expressions whose values are phone numbers in numeric form.​
    The data type of the value must be Bigint.​
    ​
  • Description of return values​
  • The return value is of the Varchar type.​
Function examples​
  • Scenarios​
  • The value of the mobile field is a phone number; you can use the MOBILE_CITY function to query the city associated with this phone number.​
  • Query and analysis statements​
  • ​
    * | SELECT MOBILE_CITY(mobile)​
    ​
MOBILE_PROVINCE function​
The MOBILE_PROVINCE function is used to analyze the province of a phone number.​
Function syntax​
  • Syntax format​
  • ​
    MOBILE_PROVINCE(KEY)​
    ​
  • Parameters description​
  • ​
    Parameter​
    Notice​
    KEY​
    Log fields and expressions whose values are phone numbers in numeric form.​
    The data type of the value must be Bigint.​
    ​
  • Return value​
  • The return value is of Varchar type.​
Function examples​
  • Scenarios​
  • mobile field values are phone numbers, and you can use the MOBILE_PROVINCE function to query the provinces to which these phone numbers belong.​
  • Statements for querying and analysis​
  • ​
    * | SELECT MOBILE_PROVINCE(mobile)​
    ​
Last updated: 2026.07.30 17:29:25