discovered the problem. The numbers had quotes in numbers. The correct syntax is the following:
SELECT distinct `discipline` FROM `books` WHERE `year`=1 OR `year`="Pré-escolar"
Thank you for the quick reply, but i'm getting the same result with both of your suggestions.
I've more rows on that table with more years. If i make this query only with numbers, it returns the disciplines of both years.
SELECT distinct `discipline` FROM `books` WHERE `year`='1' OR `year`='2'
But with 'pré-escolar' and a number it doesn't work.
Hi!
I've a table 'books' with this data:
yeardiscipline
pré-escolargeometry
1math
1english
I'm trying to do a mysql query to return the distinct disciplines with the year 'pré-escolar' and '1'. I've tried with
SELECT distinct `discipline` FROM `books` WHERE `year`="Pré-escolar" OR `year`="1"
But it only returns 'geometry'.
Can someone help me? Thx.
I have a table with the columns code, user and date (in the timestamp format. Example: 2010-07-09 11:23:42).
I'm trying to make a query with PHP and mySQL to return the rows with the timestamp of the previous day, but can't make it work.
Can someone please help me?
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.