-1

I have this table and these queries

enter image description here enter image description here

I've run both queries with these results: enter image description here

I'm confused about the line with the WHERE clause in each query. Specifically that ALL and that ANY. I understand what ALL and ANY do. Shouldn't they return a boolean value?

This syntax is confusing me. It would make sense that the first query verifies if player is different from ALL the players of Member, which would return 0 rows, and the second query verifies that player is different from ANY player of Member, which would be true if there was at least one player in the table that was different from player. Is this correct and is the syntax just a bit different from usual? If I remember right the condition should be in the parentheses and not outside of them.

1
2

The answer is, it wll return all rows.

The condition

SELECt * FROM member WHERe vname <> ANY (SELECT vname FROM member)

check for every row, it the value in not equal to ANY value in the SELECT, so if only one is not equal to the value it compares to, the condition is met, so that it is true for every column as long you SELECT all rows from the table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.