Help regarding a simple query

2006-03-13 Thread VenuGopal Papasani
Hi,
  I am searching for a query where i can have pattern matching without
considering the cases.You can consider the following example for detailed
description of what i want exactly.

   Let my table X consists of following data
Name
---
venu
venup
venugopla
VenugOpal
VENU
papasani
papasni
pvenu
  Now i need to get all the records which consists of the string
venu(case should not be considered either case should be).i.e i should get
1,2,3,4,5,8 records
 I will be very much thankful if any of you give me the query for this.

 Thanks in Advance,

Regards,
venu.
(sorry for my poor English)


RE: Help regarding a simple query

2006-03-13 Thread Jeff
 -Original Message-
 From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 13, 2006 10:33
 To: mysql@lists.mysql.com
 Subject: Help regarding a simple query
 
 
 Hi,
   I am searching for a query where i can have pattern 
 matching without considering the cases.You can consider the 
 following example for detailed description of what i want exactly.
 
Let my table X consists of following data
 Name
 ---
 venu
 venup
 venugopla
 VenugOpal
 VENU
 papasani
 papasni
 pvenu
   Now i need to get all the records which consists of the 
 string venu(case should not be considered either case should 
 be).i.e i should get 1,2,3,4,5,8 records
  I will be very much thankful if any of you give me the 
 query for this.
 
  Thanks in Advance,
 
 Regards,
 venu.
 (sorry for my poor English)
 

Won't this work?  

Select * from X where name like '%venu%'

jeff



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Help regarding a simple query

2006-03-13 Thread Peter Brawley




  Now i need to get all the records which consists of the string
venu(case should not be considered either case should be).i.e i should get
1,2,3,4,5,8 records
A simple way is ...

...
 WHERE LOCATE('venu', col_name )  0
 ...

or if the column is [VAR]BINARY, LOCATE('venu',CAST(col_name AS CHAR))
for case insensitivity.

PB

-

VenuGopal Papasani wrote:

  Hi,
  I am searching for a query where i can have pattern matching without
considering the cases.You can consider the following example for detailed
description of what i want exactly.

   Let my table X consists of following data
Name
---
venu
venup
venugopla
VenugOpal
VENU
papasani
papasni
pvenu
  Now i need to get all the records which consists of the string
venu(case should not be considered either case should be).i.e i should get
1,2,3,4,5,8 records
 I will be very much thankful if any of you give me the query for this.

 Thanks in Advance,

Regards,
venu.
(sorry for my poor English)

  
  

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006
  



No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Help regarding a simple query

2006-03-13 Thread Jeff
-Original Message-
From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 13, 2006 11:48
To: Jeff
Subject: Re: Help regarding a simple query


Hi Jeff,
   This is venu again.Last mail i did not include a constraint that is
what irritating me most.Actually if i got venu-kkk
   I should not get that venu-kkk.
   This was the query actually i want.

Can you please give me teh query for that 

Regards,
venu.

 
Please post all responses to the mailing list, not directly to another
person.

the % is a wild card character

Name
--
Venu
VENU
XVENU
yVeNu
Venuzztest

select * from X where Name like '%venu%'

returns:

Venu
VENU
XVENU
yVeNu
Venuzztest


select * from X where Name like 'venu%'

returns:
Venu
VENU
Venuzztest

select * from X where Name like '%venu'

returns:

Venu
VENU
XVENU
yVeNu

Jeff 





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]