little problem

little problem

am 30.04.2006 17:41:56 von Zdenek

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

Re: little problem

am 30.04.2006 19:21:30 von Shion

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