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.
| Author |
Topic |
|
myheart46
Starting Member
13 Posts |
Posted - 2003-11-28 : 21:30:56
|
| exampleselect name from customerwhere name between 'x1' and 'x2';if x1=0 and x2=zall record will show but name that has null will not showthen i use select name from customerwhere name between 'x1' and 'x2' or name is null;if x1='john' and x2='john' it show john and name that has null valuesplzz help me thx so much |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-11-28 : 21:51:30
|
| in an equality null will always return null which evaluates to false.???? not sure what you expect to happenwhere name between 'x1' and 'x2'name = null gives null so the record is not returnedwhere name between 'x1' and 'x2' or name is nullfor nullname between 'x1' and 'x2' returns falsename is null returns trueas there is an or condition the clause evaluates to true and the record is returned.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
myheart46
Starting Member
13 Posts |
Posted - 2003-11-28 : 22:21:59
|
| my question iswhere name between :parameter1 and :parameter2what parameter1 and 2 that make select code return all record in table |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-11-28 : 22:50:49
|
| It's not possible for that to include null valueswhere coalesce(fld,'a') between 'a' and 'z'will include the null values for fld but it's not possible without catering explicitely for null.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|