In Java,Il motivo o la condizione funziona in modo diverso rispetto a Java e SQL
int a = 10, b = 10;
if (a == 10 || b==10)
{
// first condition (a==10) is true, so it wont check further
}
Ma, in SQL,
select * from my table where a = 10 or b = 10;
--As per my understanding, It should return data only based on a.
--But it returns both entries.
Perché?
Questo non è il modo in cui il lavoro affermazioni. Presumo che quello che stai cercando di fare è ottenere tutte le righe dove a = 10 a meno che a! = 10, quindi ottenere tutte le righe con b = 10. –