DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    David M Guest

    SQL search statement


    I am in the middle of creating a database search page for a web site...

    I was wondering if an *(asterix) can be used as part of the LIKE section

    i.e.

    SELECT description, url, title FROM tblURL WHERE description =
    * & txtsearchstring & *

    would this filter out the selected fields that has the search string in the
    "descrition" field....

    any help would be appreciated

    David M


  2. #2
    Matt Guest

    Re: SQL search statement


    I would suggest using the 'like' operand in your SQL statement:
    SELECT description, url, title FROM tblURL WHERE description like
    % & txtsearchstring & %

    HTH ... Matt


    "David M" <d_mcgillivray@lineone.net> wrote:
    >
    >I am in the middle of creating a database search page for a web site...
    >
    >I was wondering if an *(asterix) can be used as part of the LIKE section
    >
    >i.e.
    >
    >SELECT description, url, title FROM tblURL WHERE description =
    >* & txtsearchstring & *
    >
    >would this filter out the selected fields that has the search string in

    the
    >"descrition" field....
    >
    >any help would be appreciated
    >
    >David M
    >



  3. #3
    L. Howell Guest

    Re: SQL search statement


    "David M" <d_mcgillivray@lineone.net> wrote:
    >
    >I am in the middle of creating a database search page for a web site...
    >
    >I was wondering if an *(asterix) can be used as part of the LIKE section
    >
    >i.e.
    >
    >SELECT description, url, title FROM tblURL WHERE description =
    >* & txtsearchstring & *
    >
    >would this filter out the selected fields that has the search string in

    the
    >"descrition" field....
    >
    >any help would be appreciated
    >
    >David M
    >


    David,

    Nope, it does not like *'s it prefers % - hope this helps!

    Leonard


  4. #4
    Bill Guest

    Re: SQL search statement


    "David M" <d_mcgillivray@lineone.net> wrote:
    >
    >I am in the middle of creating a database search page for a web site...
    >
    >I was wondering if an *(asterix) can be used as part of the LIKE section
    >
    >i.e.
    >
    >SELECT description, url, title FROM tblURL WHERE description =
    >* & txtsearchstring & *
    >
    >would this filter out the selected fields that has the search string in

    the
    >"descrition" field....
    >
    >any help would be appreciated
    >
    >David M
    >


    I just experienced a similar problem myself. Try using % instead of *

    Bill


  5. #5
    Don Wolthuis Guest

    Re: SQL search statement


    Bill is correct use %

    "Bill" <Bill@neropes.com> wrote:
    >
    >"David M" <d_mcgillivray@lineone.net> wrote:
    >>
    >>I am in the middle of creating a database search page for a web site...
    >>
    >>I was wondering if an *(asterix) can be used as part of the LIKE section
    >>
    >>i.e.
    >>
    >>SELECT description, url, title FROM tblURL WHERE description =
    >>* & txtsearchstring & *
    >>
    >>would this filter out the selected fields that has the search string in

    >the
    >>"descrition" field....
    >>
    >>any help would be appreciated
    >>
    >>David M
    >>

    >
    >I just experienced a similar problem myself. Try using % instead of *
    >
    >Bill
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links