我正在编写查询以在Couchbase中查找用户信息,我将结果获取为空数组,但我希望字段具有空结果,我曾尝试过几次,但无法获得具有空值。如何获取标题字段?
我的查询是
SELECT C.firstName AS `First Name`,
C.surName `Last Name`,
U.auditDetail.createTime AS `Date/Time of the Registration`
C.contactDetails.`email`.`value` AS `Email Address`,
C.contactDetails.`phone`.`value` AS ‘Phone Number`,
C.sex `Gender`,
C.dob AS `Data of Birth`,
ag.id AS `Referral Code`,
C.addressDetails.`office_new`.`zipcode` AS ‘Postal Code`,
C.addressDetails.`office_new.`city` AS `City`
FROM data C
UNNEST C.activeGroups AS ag
JOIN data_PH U ON U.loginld=C.contactDetails.`email`.`value`
WHERE U.type_='user'
AND C.type_= ‘customer`
结果:
{
"results": []
}
执行查询时,签名具有字段的标题
SELECT
C.firstName AS `First Name`,
C.surName `Last Name`,
U.auditDetail.createTime AS `Date/Time of the Registration`,
C.contactDetails.`email`.`value` AS `Email Address`,
C.contactDetails.`phone`.`value` AS `Phone Number`,
C.sex `Gender`,
C.dob AS `Data of Birth`,
ag.id AS `Referral Code`,
C.addressDetails.`office_new`.`zipcode` AS `Postal Code`,
C.addressDetails.`office_new`.`city` AS City
FROM default AS C
UNNEST C.activeGroups AS ag
JOIN default AS U ON U.loginld=C.contactDetails.`email`.`value`
WHERE U.type_="user"
AND C.type_= "customer";
{
"requestID": "c4a806b6-b3d7-4172-8b60-ebe195d00cef",
"signature": {
"City": "json",
"Data of Birth": "json",
"Date/Time of the Registration": "json",
"Email Address": "json",
"First Name": "json",
"Gender": "json",
"Last Name": "json",
"Phone Number": "json",
"Postal Code": "json",
"Referral Code": "json"
},
"results": [
],
"status": "success",
"metrics": {
"elapsedTime": "9.723082ms",
"executionTime": "9.616195ms",
"resultCount": 0,
"resultSize": 0
}
}