I am trying to retrieve everything from a table where the invoiceNo is distinct.So here is what I tried.
SELECT * FROM `selected_items` WHERE 'invoiceNo' IN
(SELECT DISTINCT(invoiceNo) AS invoiceNo FROM selected_items`);
When I try this in php myadmin I get the following warning with no output.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2.
And when I run my php script from my android app it returns nothing.Is there a place where I can check my query like php code checker.
I am new to programming so any help and suggestion is welcome.Thank you :)