1

次のクエリがあります

SELECT dictionaryEncryptedIndex, filelocation FROM  `DictionaryTable`
 WHERE  `dictionaryEncryptedWord` LIKE '0x0E6E'";

C# では、上記のクエリの結果をループし、ループの繰り返しごとに次のクエリを使用して最終結果を取得します。

SELECT * FROM  `MaskedIndexTable` 
 WHERE  `maskedIndexEncryptedIndex`
  LIKE '" + dictionaryEncryptedIndexFROMABOVEQUERY + "'
   AND `fileLocation` = '" + filelocationFROMABOVEQUERY + "'";

DictionaryEncryptedIndex と maskedIndexEncryptedIndex の間の関係は、1 対 1 の関係ではありません。

Microsoft Accessで使用できる1つの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#コードで得られた結果)

4

2 に答える 2