Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 20th, 2007, 07:05 AM
Authorized User
 
Join Date: Aug 2006
Location: chennai, tamilnadu, India.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to thillaiarasu
Default how to use like operator

hello i am a beginner in sql server.In my project i want to search the persons vi account number or by there name so how should i use the operator like in query


With Regards,
N.ThillaiArasu

n.thillaiarasu
__________________
N.ThillaiArasu
  #2 (permalink)  
Old April 20th, 2007, 08:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did you check Books online(BOL) for its syntax?

_________________________
- Vijay G
Strive for Perfection
  #3 (permalink)  
Old April 25th, 2007, 07:57 AM
Registered User
 
Join Date: Apr 2007
Location: mumbai, maharastra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to manish_partey
Default

you can use like after the where condition

  #4 (permalink)  
Old April 25th, 2007, 08:53 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

It is used for search matching or pattern matching
select like, from, what from booksonline
WHERE yourcolumn like '%comparison'




Jaime E. Maccou
  #5 (permalink)  
Old April 23rd, 2010, 09:47 AM
Friend of Wrox
Points: 752, Level: 10
Points: 752, Level: 10 Points: 752, Level: 10 Points: 752, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Arrow

Hello there,
the like statement will match the substring in your database you have specified in your query.
suppose you want to extract data from example table and you have a text control txtBox where you have entered into the account number/ name or any thing you wish and wanna select Id of that selected record then use the following query

Code:
select Id from example where Name like '%" & txtBox.Text & "%' "
Hope this helps.
__________________
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com

Last edited by jack_hilary; April 23rd, 2010 at 10:02 AM..


Similar Threads
Thread Thread Starter Forum Replies Last Post
having problem with Between operator anantdev SQL Language 1 May 26th, 2008 08:14 AM
=== operator in c# surendraparashar C# 2005 8 November 8th, 2007 05:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
intersect operator kapy_kal XSLT 1 March 29th, 2006 02:02 PM
Use of return operator. PC BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 July 1st, 2005 09:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.