Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL 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
 
Old August 9th, 2005, 07:01 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default search a table which has a apostrophe in it

Code:
SELECT * FROM `countryname` where CountryName like  '%'''%'
How do i search a table which has a apostrophe in it? I have tried the above, but it doesnt work.

My error is
Error: You have mismatched `'`

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old August 9th, 2005, 03:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

This is how it should be.
Code:
SELECT * FROM `dbo_tp_countryname` where CountryName like  '%\'%'
\ is the escape character in myssql.

Cheers

_________________________
- Vijay G
Strive for Perfection
 
Old August 10th, 2005, 06:23 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Code:

select * FROM airport LEFT JOIN airportname ON airport.airportcode=airportname.airportcode WHERE airportname.airportcode = ''
i have two tables airport and airportname.
airport has the airportcode KYO,
airportname doesnt.
I need to find what other airportcodes dont match up.
i.e. what airport codes are in airport but not airportname

The above syntax doesnt work.

airport TABLE STRUCTURE:
+-------------+--------------+----------+
| AirportCode | FacilityCode | CityCode |
+-------------+--------------+----------+
| AAA | A | AAA |
| AAB | A | AAB |
+-------------+--------------+----------+

airportname TABLE STRUCTURE:
+--------------+-------------+-------------------------------+
| LanguageCode | AirportCode | AirportName |
+--------------+-------------+-------------------------------+
| GB | AAA | Anaa |
| GB | AAB | Arrabury |
+--------------+-------------+-------------------------------+

Thanks.

Picco

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt





Similar Threads
Thread Thread Starter Forum Replies Last Post
how I can search required information form table GeoIrshad Access VBA 1 March 13th, 2008 06:31 AM
Query to Search for a value in a table Vendirella SQL Language 0 October 10th, 2007 12:47 AM
Search for a client in a table lwager VB How-To 2 May 5th, 2006 01:16 PM
search table? bmurty Access VBA 1 September 21st, 2005 06:51 AM





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