
- Forum
- Database
- SQL Server
- SELECT Statement - Help
SELECT Statement - Help
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 ...
-
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.
-
SQL Server 2005 Help
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.
-
03-06-2006, 03:22 PM #3
Please read teh following tutorials on SQL Server 2005...
http://www.exforsys.com/content/view/1616/356/1/1/
-
12-19-2006, 01:47 PM #4
- Join Date
- Dec 2006
- Answers
- 1
select ename from table name
where ename like'%William%';
write the table name from where u have to extract the data
-
If a user wants to give the value only during run time then how can one handle the matching of pattern.
-
12-25-2006, 12:55 AM #6
- Join Date
- Dec 2006
- Answers
- 3
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
-
nickole our friends have made a detailed resposne to your query.Did you try and did you get the result. Do update us.
-
Let's say the value from your program comes in the param @name:
CREATE PROC dbo.GetForAngela @name varchar(100)
AS
BEGIN
SET @name = '%' + @name + '%'
SELECT various_things
FROM AngelasTable
WHERE name LIKE @name
END
-
Sponsored Ads

Reply With Quote






