|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with STARTING WITH
I used 'like', but I want to firebird use my index.
my request : select * from mytable where num_client starting with :client ( client = 'A' or all) Maybe, :client starting with 'A'...and sometime, I want all client. I use 'STARTING WITH :PARAMETER' I've read in another thread : using "starting with", if parameter is null will return all the data, else it will return the field that containt the parameter[/B] but if my parameter is null, i've no line in response. |
|
#2
|
|||
|
|||
|
Quote:
Use select * from mytable where num_client starting with '' |
|
#3
|
|||
|
|||
|
Thank you for your response.
My request : client = ''; SELECT * FROM MYTABLE WHERE NUM_CLIENT starting with :client And I have no ligne. |
|
#4
|
|||
|
|||
|
Quote:
First, you should get nothing if you pass in NULL. In SQL NULL IS NULL. It has no known value. Standard SQL operation is to ignore all NULLs in where clauses unless they are specifically specified by the clauses Code:
where myField IS NULL or where MyField IS NOT NULL As you appear to be searching for client names then if you are looking for null client names you will need to use a construct as above. If you are trying to return ranges of values and use an index then why not use a BETWEEN clause? Code:
where NUM_CLIENT BETWEEN :FirstClient and :LastClient Setting FirstClient to 'A' and LastClient to :zzz should return all names and use your index. Clive |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Problem with STARTING WITH |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|