我正在开发一个Android应用程序,我需要使用下面的查询,
SELECT distinct AttributeValue.AttributeValueName as InventoryId
,WorkFlowTransaction.WorkFlowTransId
,Client.ClientName
,Project.ProjectName
,Product.ProductName
FROM WorkFlowTransaction
JOIN AttributeValue
ON WorkFlowTransaction.WorkflowTransId = AttributeValue.WorkflowTransId
JOIN Attribute
on Attribute.AttributeId = AttributeValue.AttributeId
JOIN Product
on Product.ProductId = WorkFlowTransaction.ProductId
JOIN Client
ON Client.ClientID=WorkFlowTransaction.ClientId
JOIN Project
on Project.ProjectID=WorkFlowTransaction.ProjectId
where AttributeValue.AttributeValueName
COLLATE SQL_Latin1_General_CP1_CI_AS not in (
Select LocationId
from BarcodeDetails
)
and Attribute.AttributeName = 'Inventory Id'
and WorkFlowTransaction.ClientId = 2
and WorkFlowTransaction.ProjectId = '44'
and WorkFlowTransaction.ProductId = '47'
and Attribute.IsDeleted ='0'
and AttributeValue.IsDeleted ='0'
and WorkFlowTransaction.IsDeleted = '0'
此查询在SQL-Server
中运行良好。但在Android中抛出no such collation sequence: SQL_Latin1_General_CP1_CI_AS
异常。
请帮助我提出您的想法或解决方案。
答案 0 :(得分:1)
要了解整理顺序,请参阅此问题:What does 'COLLATE SQL_Latin1_General_CP1_CI_AS' do?
latin1
使服务器使用charset latin 1处理字符串,基本上是asciiCI
不区分大小写的比较,因此'ABC'将等于'abc'- 醇>
AS
重音敏感,所以'ü'不等于'u'
在SQLite中没有直接替代它,Android SQLite不会公开安装自己的自定义归类序列所需的API。
根据您的数据和要求,您可以使用普通的COLLATE NOCASE
与ASCII字符配合使用,但不能使用完整的Latin1字符集。