mysql - How to change results to display a different name SQL -
is there way in can change way in see results of query?
i'll use example. have table id of market, , name of market, , sport id. want the sport id displayed sport name instead.
select id, name, sport_id markets sport_id = 2; i thinking like:
select * markets sport_id = 2 'football'; but didn't work. don't want modify results update would, want results displayed football instead of sport_id 2.
is possible?
if have 1 table , give alias go query 1
select id, name, sport_id 'sport name' markets sport_id = 2; or
if have 2 different tables go need join other table given below
select m.id, m.name, t.sport_name markets m join other_table t on m.sport_id = t.sport_id m.sport_id = 2; i hope might helpful solve issue.
Comments
Post a Comment