# 生成SQL语句 API
调用方法请参见Open API文档中的调用方法描述。
# 一、生成查询用户的SQL语句 (从版本 3.2.1 开始支持)
[POST /open/get-sql-for-user-search?token=xxxxxx&projectId=377]
- Request body (application/json)
{
"filter": {
"filterType": "COMPOUND",
"relation": "and",
"filts": [
{
"filterType": "SIMPLE",
"tableType": "user",
"columnName": "city",
"comparator": "equal",
"ftv": [
"上海市"
]
},
{
"filterType": "SIMPLE",
"tableType": "user",
"columnName": "companynature",
"comparator": "equal",
"ftv": [
"民营"
]
}
]
},
"selectAllColumns": false,
"selectColumns": [
"#account_id", "#distinct_id"
]
}
参数 | 描述 |
---|---|
filter | 筛选器,filterType 可为 COMPOUND(复合类型)或 SIMPLE(简单类型) |
selectAllColumns | 是否选择用户表所有可见物理属性,默认为false |
selectColumns | selectAllColumns为true时有效。#user_id字段系统默认会添加 |
- Response body (application/json)
{
"data": {
"sql": "select \"#user_id\", \"#account_id\", \"#distinct_id\" from (v_user_377) where (\"city\" IN ('上海市')) and (\"companynature\" IN ('民营'))"
},
"return_code": 0,
"return_message": "success",
"showStackMessage": false
}