little problem

Hello
I have a problem with mysql query
I have a table Teams and field 'date' (12-01-2006 format)

I want to see all records but date format I want is 12/01 %d/%m

My query

SELECT Date, p.Category, t1.Teams, t2.Teams, Prediction, Stake, Odds,
Win_Lose, Profit, Score, ZakladyID
FROM
Teams as t1, Teams as t2, Zaklady as m, Category as p
WHERE
Win_Lose = '' AND
p.CategoryID = m.Category AND
t1.TeamsID = m.Team1 AND
t2.TeamsID = m.Team2


How can I make it
Please help me in making right query

Best Regards
Pat
Zdenek [ So, 30 April 2006 17:41 ] [ ID #1295499 ]

Re: little problem

Zdenek wrote:
> Hello
> I have a problem with mysql query
> I have a table Teams and field 'date' (12-01-2006 format)
>
> I want to see all records but date format I want is 12/01 %d/%m

SELECT CONCAT(SUBSTR(Date,0,2),'/',SUBSTR(Date,3,2)), p.Category, t1.Teams,
t2.Teams, Prediction, Stake, Odds, Win_Lose, Profit, Score, ZakladyID FROM
Teams as t1, Teams as t2, Zaklady as m, Category as p WHERE Win_Lose = '' AND
p.CategoryID = m.Category AND t1.TeamsID = m.Team1 AND t2.TeamsID = m.Team2

Should work, but sure there are better ways to do it.



//Aho
Shion [ So, 30 April 2006 19:21 ] [ ID #1295500 ]
PHP » alt.php.sql » little problem

Vorheriges Thema: How to make it shorter and better?
Nächstes Thema: How to set decimal separator?