This is a discussion on SELECT Statement - Help within the SQL Server forums, part of the Database category; Hi, I am new into SQL, How to use SELECT statement to fetch records based on a partial match in ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
SELECT Statement - Help
Hi,
I am new into SQL, How to use SELECT statement to fetch records based on a partial match in a text field. Say for ex., I want to retrieve all names with has the "William" in any part of the name field. How to write a query for the above Scenario? Thanks in advance. |
|
|||
|
hi. i am new to SQL server 2005. whenever i tried to create database through SQL sever Management studio, it asked me:
server type: (here i select Database Engine) server Name : ( ??????????) Authentication : (Windows Authentiction is by default, another is SQL server Authentication, which one should i select?????????) i just have no idea what to do with server name. i have Internet Information Services (IIS) installed in my system. plsssssssssss help me. |
|
||||
|
Please read teh following tutorials on SQL Server 2005...
http://www.exforsys.com/content/view/1616/356/1/1/
__________________
Regards, Admin http://www.exforsys.com http://www.geekinterview.com http://www.itquestionbank.com http://www.myitblog.com |
|
|||
|
Quote:
where ename like'%William%'; write the table name from where u have to extract the data |
|
|||
|
is this u want
SQL> create table ex(name char(20),id number); Table created. SQL> insert into ex values('&name',&id); Enter value for name: p will Enter value for id: 1 old 1: insert into ex values('&name',&id) new 1: insert into ex values('p will ',1) 1 row created. SQL> / Enter value for name: will g Enter value for id: 2 old 1: insert into ex values('&name',&id) new 1: insert into ex values('will g',2) 1 row created. SQL> / Enter value for name: p will g Enter value for id: 3 old 1: insert into ex values('&name',&id) new 1: insert into ex values('p will g',3) 1 row created. SQL> select * from ex where name like '%will%'; NAME ID -------------------- ---------- p will 1 will g 2 p will g 3 |
|
|||
|
Quote:
CREATE PROC dbo.GetForAngela @name varchar(100) AS BEGIN SET @name = '%' + @name + '%' SELECT various_things FROM AngelasTable WHERE name LIKE @name END |