Select Null statement, Is it possible?
mysql
Solution
Is this what you need
SELECT null FROM table where password= 'abc'
Problem
I am creating a Java application which uses the log in mechanism, to test this, I am using a SELECT loginname FROM TABLE WHERE password="abc". This is actually selecting a tuple from the table, I pass this into the result statement rs and then test for rs.next() and if it's true, then the entered username and password is correct. I just had a question, is it possible to run a SELECT statement which returns no data but still marks the tuple? i.e. The query should return a set of rows equivalent to the number of matches, but they should all be null. I do not want to use COUNT and other functions. I just wanted to know, whether this is technically possible? e.g. SELECT NONE FROM TABLE WHERE password="abc". Edit: I am using MySQL