我想检索一个客户名称列表以及使用自定义属性注册的已分配客户经理和区域的列表。
使用以下查询,我得到每个客户多行:
select accountclassifications_account_name
, property_code_attr
, property_description
from exactonlinexml..accountclassifications
where property_code_attr in ( 'BO', 'REGION' )
但我想在帐户管理员和地区都有一个字段。怎么做?
答案 0 :(得分:0)
使用组功能// FUNCTION WITH ERROR
func space (toprint: Int) {
var spaces = [" ", " ", " ", " ", " ", " ", " "]
var digits = [Int] ()
var toprinttemp = toprint
while toprinttemp >= 1 {
digits.append(toprint%10)
toprinttemp = toprinttemp/10
}
let count = (digits.count - 1)
print("(\(spaces[count])", terminator:"")
}
// Print top row
var counter = 0
while (counter) <= (rows - 1) {
if (tlcorner - counter) <= userinput {
var toprint:Int = (tlcorner - counter)
print("\(toprint)", terminator:"")
// Calling Function
space(toprint:Int)
}
counter += 1
}
,您可以为每个客户帐户检索多个值:
listagg
如果需要其他分隔符,可以将其指定为select accountclassifications_account_name
, listagg(property_code_attr || ': ' || property_description) lst
from exactonlinexml..accountclassifications
where property_code_attr in ( 'BO', 'REGION' )
group
by accountclassifications_account_name
的单独参数。