i have table like this
name houseno address id
svr 3-13-01 hyd 0001
sht 3-13-02/b hyd 0008
sama 3-13-01/9 hyd 0009
raj 3-13-14 hyd 0003
prasf 3-13-20 hyd 0009
sameer 3-13-98 hyd 0035
raju 3-13-33/b hyd 00098
praveen 3-13-14/b hyd 00076
i wnt select only particular house no only
like :3-13-01 to 3-13-20 only
i want o/p like this .....orderded by houseno
name houseno address id
svr 3-13-01 hyd 0001
sama 3-13-01/9 hyd 0009
sht 3-13-02/b hyd 0008
raj 3-13-14 hyd 0003
praveen 3-13-14/b hyd 00076
prasf 3-13-20 hyd 0009
plz write quarie.........
Loading

Hanook159 reputationPosted Nov 4, 2013, 12:15 AM EST
yamini b2 reputationPosted Nov 4, 2013, 12:22 AM EST
try this
select * from tablename where charindex('/',houseno)=0
this will fetch only houseno exculding this (' 3-13-01/9') type of format
thanks
yamini
JAYRAMRank #7,836 · 233 reputationPosted Nov 4, 2013, 12:56 AM EST
Msg 105, Level 15, State 1, Line 3
Hanook159 reputationPosted Nov 4, 2013, 1:13 AM EST
SELECT * FROM Tablename
WHERE houseno between '3-13-01' and '3-13-20'