Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 MySQL letter incremental

Author  Topic 

djavet
Starting Member

36 Posts

Posted - 2005-06-20 : 10:35:51
Hello

I've made a litte Address applicaton with php and MySQL and I wish pass the start letter trough a url variable to sort the addresses.

I use this query:
SELECT nom, prenom, code_pays_rel, pays, code_pays
FROM contacts, pays
WHERE contacts.code_pays_rel=pays.code_pays AND nom >= 'G' AND nom < 'G'
ORDER BY pays, nom asc



How could I select only the adress starting "G" and not the other?
Is that possible to have a query like
nom >='G' AND nom < 'G+1'

To have:
nom >='G' AND nom < 'H'


As I said, I pass the letter via a URL parameter ('G' in my exemple) and I don't know wish one (client side).

How do you made this?

A lot of thx for your help and times,
Dominique

Kristen
Test

22859 Posts

Posted - 2005-06-20 : 10:39:19
This possibly:

AND nom >= 'G' AND nom <= 'G' + 'zzzzzzzzzzz'

Kristen
Go to Top of Page

djavet
Starting Member

36 Posts

Posted - 2005-06-20 : 10:54:44
Thy a lot.
Damn, it's a quick reply!

Regards, DOm
Go to Top of Page
   

- Advertisement -