sql - Can any one simplify this query -
i have table this
firstcity secondcity distance roadname roadstatus 008 007 4.600 a4 008 020 4.400 a4 005 008 4.300 a3
i want select rows particular city id first city or second city.furthermore assume city id 006. want records having either of city number 006. don't want 006 displayed. want other city number of record no matter column distance, roadname , road status. have tried this.
select * directnodes firstcity='008' or secondcity='008';
it gives me 5 columns. want other city number of records having 008 without 008. output should this.
city distance roadname roadstatus 007 4.600 a4 020 4.400 a4 005 4.300 a3
can tell me how achieve this.
try this
select case when firstcity = '008' secondcity else firstcity end 'city', distance,roadname,roadstatus table (firstcity= '008' or secondcity ='008')
Comments
Post a Comment