我想通过比较SAMPLE2中的FruitName来从SAMPLE1中选择不匹配的数据 到目前为止我已经尝试了
SELECT * FROM SAMPLE1,SAMPLE2 WHERE SAMPLE1.FruitName NOT LIKE '%' + dbo.SAMPLE2.FruitName +'%'
答案 0 :(得分:2)
SELECT *
FROM SAMPLE1 s1
WHERE NOT EXISTS (
SELECT NULL
FROM SAMPLE2 s2
WHERE s1.FruitName LIKE '%' + s2.FruitName + '%'
)
答案 1 :(得分:1)
试试这个:
SELECT * FROM SAMPLE1,SAMPLE2 WHERE SAMPLE1.FruitName NOT LIKE '%' + dbo.SAMPLE2.FruitName +'%' AND SAMPLE1.id = SAMPLE2.id
必须确保您正在比较相同的ID。
答案 2 :(得分:1)
也许有帮助:
username = input("Enter your username: ")
password = input("Enter your password: ")
#hashing
p = len(password)+3
hashValue = 0
for element in password:
hashValue += ord(element)*(37**(p*3+2))
p += 1
#file reading
searchfile = open("users.txt","r")
for line in searchfile:
if username in line:
print(line)
passwordFile = next(searchfile)
if hashValue == int(passwordFile):
print("Succesfully logged in.")
else:
print("Denied.")