0
SELECT column name
FROM table_name
WHERE column name LIKE 'A%'
try this it will display the record that start with latter 'A'
0
0
suppose in table have three row in name column.
aadity
shail
jjkka
your query value is a
select * from tableName where columnName like "''+your query value+'%'" -- this query working only start with your query value.
output is aadity
select * from tablename where columnName like "'%'+@name+''" -- this query working only end with your query value.
output is jikka
select * from tablename where columnName like "'%'+@name+'%'" -- this query working match a your query value complete value.
output is
aadity
shail
jjkka
0
what is the difference between 2nd one and the third one can you please elaborate with an example
0
yes this is what i want. but if s comes with other names those names should not display.
text boxes are there to find records it is not specifically the word starting with s. i need the query to display record as i directed to textboxes.
e.g: if a comes in aaditya and a also comes in sahil then, aaditya should display but not sahil.
0
Hi umair,
your query is wrong because you want start with S but you are assign complete value. if you want records only start with S just changed your query like
select * from tableName where columnName like "''+your query value+'%'" -- this query working only start with your query value.
select * from tablename where columnName like "'%'+@name+''" -- this query working only end with your query value.
select * from tablename where columnName like "'%'+@name+'%'" -- this query working match a your query value complete value.
0
use like clause
select * from student_table where name like "''+@name+'%'"
0
Hii, Do u want to display the names to start with "s" right??