我有以下查询
SELECT dictionaryEncryptedIndex, filelocation FROM `DictionaryTable`
WHERE `dictionaryEncryptedWord` LIKE '0x0E6E'";
在 c# 中,我循环遍历上述查询的结果,并且对于每个循环迭代,我使用以下查询来获取最终结果:
SELECT * FROM `MaskedIndexTable`
WHERE `maskedIndexEncryptedIndex`
LIKE '" + dictionaryEncryptedIndexFROMABOVEQUERY + "'
AND `fileLocation` = '" + filelocationFROMABOVEQUERY + "'";
dictionaryEncryptedIndex 和 maskedIndexEncryptedIndex 之间的关系不是一对一的关系。
有谁知道如何在一个可以在 Microsoft Access 中使用的 SQL 查询中执行上述操作?
我尝试了多种方法,例如:
SELECT * from DictionaryTable, MaskedIndexTable
WHERE MaskedIndexTable.maskedIndexEncryptedIndex = DictionaryTable.dictionaryEncryptedIndex
AND MaskedIndexTable.fileLocation =DictionaryTable.fileLocation
AND `dictionaryEncryptedWord` LIKE '0x0E6E'
SELECT dictionaryEncryptedWord, DictionaryTable.filelocation
FROM DictionaryTable
INNER JOIN MaskedIndexTable
ON (MaskedIndexTable.maskedIndexEncryptedIndex =DictionaryTable.dictionaryEncryptedIndex )
WHERE `dictionaryEncryptedWord` LIKE '...'
SELECT distinct *
FROM MaskedIndexTable
INNER JOIN DictionaryTable
ON (MaskedIndexTable.maskedIndexEncryptedIndex = DictionaryTable.dictionaryEncryptedIndex )
WHERE MaskedIndexTable.Id IN
(
SELECT DictionaryTable.Id
FROM DictionaryTable
WHERE `dictionaryEncryptedWord` LIKE '..')
AND `dictionaryEncryptedWord` LIKE '...'
但它们似乎都没有产生正确的结果(我用我的 c# 代码得到的结果)