I have a question regarding an SQL syntax.
I have a mysql table like this (id, name, subid, preview) where preview is set to 0 as default. So now I want to make a select to query only lines where preview is different from zero.
Can I do this in a single query .. or I need to query all and then make (if else) decisions?
like SELECT * FROM table_name; – and iterate through … ?
You could do
!=means “not equal to”. Some databases also use<>for the same meaning.If preview is nullable, do you also want to return rows where preview is null? If so, you may want to try: