Wrox Programmer Forums
|
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
 
Old October 14th, 2008, 09:07 AM
Authorized User
 
Join Date: Apr 2006
Posts: 31
Thanks: 1
Thanked 0 Times in 0 Posts
Default Select Problem - Newbie

I have a large database and need to find records with a particular word in the title.

In the SQL pane I used:

SELECT *
FROM MyTable
WHERE (BookTitle = 'sunrise')

Now, this gives me one book with only "Sunrise" as the title. But I want all titles with "Sunrise" in them. How do I change my query to find them?

Thanks in advance.

 
Old October 14th, 2008, 02:25 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

SELECT * FROM MyTable WHERE BookTitle LIKE '%sunrise%'

Try that.

 
Old October 14th, 2008, 05:07 PM
Authorized User
 
Join Date: Apr 2006
Posts: 31
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Perfect! Thanks a million. I'm writing this one down and pasting it on my monitor!! <GRIN>

 
Old October 14th, 2008, 07:44 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Glad you like it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie needs help creating Select statement! Mintyman SQL Language 4 November 13th, 2006 01:11 PM
record add problem newbie here jdsflash ASP.NET 1.0 and 1.1 Basics 3 May 19th, 2006 12:04 PM
Newbie in need of help With Select Statement alex350r Oracle 1 December 1st, 2005 10:50 AM
Stored Proc. problem - newbie joeb SQL Server 2000 5 November 22nd, 2004 06:18 AM





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