SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Question
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 05/16/2005 :  08:23:23  Show Profile  Visit AskSQLTeam's Homepage
priyabrat routray writes "i have a table named as PersonDetails.having fields PersonID ,PersonName.I have some records .The personName field contains some records like "ABC DEF","ABC","XYZ ABC","ABC KKKSS".
I want to retrive some records which personname does not contain the word "ABC" but i want to retive records which personname field contain the value"ABC DEF""

DonAtWork
Flowing Fount of Yak Knowledge

2166 Posts

Posted - 05/16/2005 :  08:51:33  Show Profile
select * from PersonDetails where PersonName = 'ABC DEF'
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 05/16/2005 :  13:21:03  Show Profile  Visit nr's Homepage
select * from PersonDetails where PersonName = 'ABC DEF' or PersonName not like '%ABC%'

Any other guesses as to what the question is?


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2166 Posts

Posted - 05/16/2005 :  14:33:19  Show Profile
Occam's razor. Simple explanation is the right one

*need more coffee*
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000