select names starts with a,b,c

Answers were Sorted based on User's Feedback



select names starts with a,b,c..

Answer / lakshmi narayanan r

SELECT * FROM abc a WHERE a.ename LIKE '[a-c]%'

Is This Answer Correct ?    19 Yes 1 No

select names starts with a,b,c..

Answer / prashant

SELECT NAMES FROM TABLE_NAME
WHERE NAME LIKE 'a%'
or NAME LIKE 'b%'
or NAME LIKE 'c%'

Is This Answer Correct ?    16 Yes 6 No

select names starts with a,b,c..

Answer / naren

Lakshmi Narayanan u r correct.
But we can use the table only.

SELECT * FROM abc WHERE ename LIKE '[a-c]%'

I think its better...

Is This Answer Correct ?    10 Yes 2 No

select names starts with a,b,c..

Answer / senthil

SELECT NAMES FROM TABLE_NAME
WHERE lower(NAME) LIKE 'a%'
or lower(NAME) LIKE 'b%'
or lower(NAME) LIKE 'c%';

Is This Answer Correct ?    8 Yes 3 No

select names starts with a,b,c..

Answer / rajkumar v

SELECT * FROM TABLE_NAME WHERE Colum_Name LIKE '[a-c]%'
OR
SELECT * FROM TABLE_NAME WHERE Colum_Name LIKE '[a,b,c]%'

Is This Answer Correct ?    1 Yes 0 No

select names starts with a,b,c..

Answer / gopinath

SELECT NAMES FROM TABLE_NAME
WHERE NAME LIKE 'a%'
or NAME LIKE 'b%'
or NAME LIKE 'c%'

Is This Answer Correct ?    2 Yes 2 No

select names starts with a,b,c..

Answer / roopesh kumar

Select * From emp Where substr(ename,1,1) In
('a', 'b', 'c', 'S');

Is This Answer Correct ?    1 Yes 4 No

select names starts with a,b,c..

Answer / naren

select * from table_name where Name like 'A%'
union
select * from table_name where Name like 'B%'
union
select * from table_name where Name like 'C%'

Is This Answer Correct ?    6 Yes 10 No

Post New Answer

More SQL Server Interview Questions

What is Data model and how to prepare a data model.?

1 Answers   TCS,


What are the differences between triggers and stored procedures?

0 Answers  


What is a covered index?

0 Answers  


What is onf in normalization form?

0 Answers  


Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?

0 Answers  






What are different types of raid levels?

0 Answers  


How do I view a procedure in sql server?

0 Answers  


Can you change the data type of a column in a table after the table has been created? If so, which command would you use?

0 Answers  


Can we use where clause with group by?

0 Answers  


How get current date in SQL server 2000

4 Answers   Cap Gemini, Polaris,


How to genrate automaticlly empid like gt001

4 Answers  


What is difference between views and stored procedures?

0 Answers  


Categories