Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
tsaliki
Starting Member
19 Posts |
Posted - 2013-04-15 : 01:14:48
|
I have a tablecreate table accounts(accname varchar(100),recstatus bit)and records are as follows:Insert into accounts values ('Pepsi Co',0)Insert into accounts values ('Pepsi Co',0)Insert into accounts values ('Prudential',1)Insert into accounts values ('Lennox International',1)Insert into accounts values ('Eurosystems (Harveynash Inc) [OLD]',0)Insert into accounts values ('ETJ Holdings, inc. [OLD]',0)Insert into accounts values ('I-nnovate [OLD]',1)Insert into accounts values ('Iflowsoft, LLC [OLD]',1)Insert into accounts values ('1st OBJECT Inc [OLD]',0)Insert into accounts values ('Jet Aviation Holdings, Inc [OLD]',0)Now i want to get the values of the table whose accname contains [old].So please help me |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-15 : 01:19:06
|
SELECT *FROM accountsWHERE accname LIKE '%[[OLD]]'--Chandu |
 |
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2013-04-15 : 01:22:26
|
[code]select * from accountswhere accname like '%[[OLD]]%'[/code]Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mutsabinWeb |
 |
|
tsaliki
Starting Member
19 Posts |
Posted - 2013-04-15 : 01:25:13
|
@Thank you bandi |
 |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-15 : 01:27:40
|
quote: Originally posted by tsaliki @Thank you bandi
Welcome If you want accname ending with [OLD] --> '%[[OLD]]'If you want accname contains [OLD] --> '%[[OLD]]%'--Chandu |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|