SELECT the first letter MATCH in mySQL

2002-04-19 Thread Son Nguyen
I want to select all the records, which have the first letter matched the letter 'A'. $SQL_get_lyrics = SELECT lyric_title FROM lyrics WHERE lyric_title LIKE \'A%\'; Some how this statement given me other record, which has the letter A inside, too like: Know A Word and other other

Re: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Jan Peuker
There is a method using trim() but I think it's better to use RLIKE ^A.* regards, Jan Peuker - Original Message - From: Son Nguyen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 19, 2002 8:42 AM Subject: SELECT the first letter MATCH in mySQL I want to select all

Re: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Charles Brisson
This works on MsSQL: SELECT lyric_title FROM lyrics WHERE LEFT(lyric_title,1)='A' I want to select all the records, which have the first letter matched the letter 'A'. $SQL_get_lyrics = SELECT lyric_title FROM lyrics WHERE lyric_title LIKE \'A%\'; Some how this statement given me other

RE: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Mikael Hultén
: SELECT the first letter MATCH in mySQL Importance: High This works on MsSQL: SELECT lyric_title FROM lyrics WHERE LEFT(lyric_title,1)='A' I want to select all the records, which have the first letter matched the letter 'A'. $SQL_get_lyrics = SELECT lyric_title FROM lyrics WHERE lyric_title LIKE

Re[2]: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Toomas Vendelin
Hello Mikael, Just add LIMIT 10 (which is equivalent to LIMIT 0,10) to show the first 10 records, and LIMIT 10,10 to show 10 records starting from 10. This issue is covered in online docs. Regards, Tom Friday, April 19, 2002, 9:18:53 AM, you wrote: MH This brings up another question to

Re: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Paul DuBois
Peuker - Original Message - From: Son Nguyen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 19, 2002 8:42 AM Subject: SELECT the first letter MATCH in mySQL I want to select all the records, which have the first letter matched the letter 'A'. $SQL_get_lyrics = SELECT

Re[2]: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Toomas Vendelin
Hello Paul, But RLIKE won't use indexes (even if they exist), so why RLIKE '^A' is better than LIKE 'A%', if LIKE which starts at the beginning of the string **will** use indexes? Regards, Tom PD Regular expression patterns (unlike SQL patterns) don't need to match the PD entire string, so

Re[2]: SELECT the first letter MATCH in mySQL

2002-04-19 Thread Paul DuBois
At 15:29 +0200 4/19/02, Toomas Vendelin wrote: Hello Paul, But RLIKE won't use indexes (even if they exist), so why RLIKE '^A' is better than LIKE 'A%', if LIKE which starts at the beginning of the string **will** use indexes? I was comparing RLIKE '^A.*' to RLIKE '^A', not RLIKE to LIKE.