mysql question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    mysql question

    i have a table with 1 column (authors) in this form:

    row1: ..,Sam,Jhon_Wilson,Mike,Terry,...
    row2:...,Dona,Jhon,Wilson,David,...
    row2:...,Jenny,Barbara,Anderson,...

    i want to make a select: select from books where authors like '%,Jhon_Wilson,% in order to retourn the fist row but this select is returning both rows (first row with ,Jhon_Wilson, and second row with ,Jhon,Wilson,)

    what is the correct sintax to retourn only the fist row?
  • apson
    Registered User
    • Apr 2006
    • 4

    #2
    Oh wow...you should never have a table with data like that. Anyway... add LIMIT 1 onto the end of your sql.

    Comment

    • beta-tester
      Rock 'n Roll Baby!
      • Sep 2004
      • 22562

      #3
      bad idea....
      I just think you missed one '
      try this query:

      SELECT FROM books WHERE authors like '%,Jhon_Wilson,%';

      Sig for sale. Affordable prices. Contact me and get a great deal ;)

      My contact:
      ICQ: 944-320-46
      e-mail: manca {AT} HotFreeSex4All.com

      Comment

      • digifan
        The Profiler
        • Oct 2002
        • 14618

        #4
        Jhon or John?
        [email protected]
        Webair Rocks

        Comment

        Working...