Я использую предложение Where Exists
для фильтрации данных из таблицы, но оно не работает.
Идея состоит в том, чтобы получить данные из трех условий из одного столбца Fav
.
Я использую:
sqlstr = "Select ID from Greyhounds where " _
& " (Distance between " & distmin & " And " & distmax & " )" _
& " And (ODD between " & convOddmin1 & " And " & convOddmax1 & ")" _
& " And (Fav = 1 )" _
& " And (Runners between " & runmin & " And " & runmax & " )" _
& " Where EXISTS " _
& "(Select ID from Greyhounds where " _
& " (Distance between " & distmin & " And " & distmax & " )" _
& " And (ODD between " & convOddmin2 & " And " & convOddmax2 & ")" _
& " And (Fav = 2 )" _
& " And (Runners between " & runmin & " And " & runmax & " ))" _
& " Where EXISTS " _
& "(Select ID from Greyhounds where " _
& " (Distance between " & distmin & " And " & distmax & " )" _
& " And (ODD between " & convOddmin3 & " And " & convOddmax3 & ")" _
& " And (Fav = 3 )" _
& " And (Runners between " & runmin & " And " & runmax & " ))"
Большое спасибо!