GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   mysql question (https://gfy.com/showthread.php?t=596099)

alex79 04-09-2006 12:29 PM

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 04-09-2006 12:36 PM

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

beta-tester 04-09-2006 01:16 PM

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

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

digifan 04-09-2006 01:31 PM

Jhon or John?


All times are GMT -7. The time now is 08:17 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123