I want to select all values that does not have a zero from the db using. But in this case I am getting all values with a zero too
SELECT column_name(s)
FROM table_name
WHERE column_name <> value
How do I get to use <>
in the above query and achieve what I require.
Thanks Jean
This one select every row where colum_name is not value.
SELECT column_name(s)
FROM table_name
WHERE column_name <> value
This one select every row where colum_name does not have value in it. Is that your problem ?
SELECT column_name(s)
FROM table_name
WHERE column_name NOT LIKE '%value%'
Is this what you want - returns all values in column_name which are not equal to 0
SELECT column_name(s)
FROM table_name
WHERE column_name <> 0
SELECT column_name(s)
FROM table_name
WHERE column_name > value (0 -> in this case)
that will give you desired results.
!=
is an operator as well - http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_not-equal
$countLoad = 'SELECT * FROM stuffing_' . FIN_YEAR .
' WHERE gatlID=' . $gatlID . ' AND StuffingID NOT IN' .
'("SELECT * FROM load_assigned_' . FIN_YEAR . ')';