How to print one row only ?

A

Anonymous

Guest
I've got in a table several entries (like dates) and of course several rows with the same date. I'd like to print only one row of each date on a page. With something like a 'like statement'
I get my result but if I have 10 times the same date I'll print 10 lines on my page instead of ONE only.

Is there a way to do that ? and how? I'll appreciate a clear exemple.

Thanks a lot for your help.
Erick.
 
Pejone said:
Code:
SELECT * FROM `table` LIMIT 0, 1

Thanks for your answer.

It works but this is not the result I wanted because how I explain my problem was wrong.
I actualy have several rows with the same date AND different dates.
Exemple: 29 dec.2002
29 dec.2002
29 dec.2002
30 dec.2002
30 dec.2002
31 dec.2002
31 dec.2002 etc...

What I'd like to print is: 29 dec.2002
30 dec.2002
31 dec.2002

I hope it's clearer now.
One more thing: The querry I had has changed and the (LIMIT statement doesn't work any longer - I think)
The new querry I have is:

$q = "SELECT
F_Num, Date, User_ID, User_Country
FROM
tableA, tableB
WHERE
tableA.User_ID = tableB.User_ID
ORDER by Date desc
";

Thank to all for your help, and Happy new year
Erick
 
Hi,

is that what you where looking for?

$q = "SELECT
F_Num, Date, User_ID, User_Country
FROM
tableA, tableB
WHERE
tableA.User_ID = tableB.User_ID
GROUP by Date <---------- !!!!!!!
ORDER by Date desc
";
 
jemy said:
Hi,

is that what you where looking for?

$q = "SELECT
F_Num, Date, User_ID, User_Country
FROM
tableA, tableB
WHERE
tableA.User_ID = tableB.User_ID
GROUP by Date <---------- !!!!!!!
ORDER by Date desc
";

Thanks a lot.....
I completely forgot that one !!! 'GROUP by Date' !
Erick
 
Back
Top