1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
| CREATE DATABASE '..\Data\Base.fdb' page_size 4096 DEFAULT CHARACTER SET ISO8859_1;
-- ============
-- table "test"
-- ============
create table test (
id integer not null,
prefixe integer,
suffixe integer
);
-- =======================
-- insertion dans 'test'
-- =======================
insert into test (id,prefixe,suffixe) values (1, null, null);
insert into test (id,prefixe,suffixe) values (2, null, 55);
insert into test (id,prefixe,suffixe) values (3, null, 66);
insert into test (id,prefixe,suffixe) values (4, 55, null);
insert into test (id,prefixe,suffixe) values (5, 66, null);
insert into test (id,prefixe,suffixe) values (6, 55, 66);
insert into test (id,prefixe,suffixe) values (7, 66, 55);
insert into test (id,prefixe,suffixe) values (8, 55, 55);
insert into test (id,prefixe,suffixe) values (9, 66, 66);
-- ================
-- Vidage de 'test'
-- ================
select * from test;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
2 <null> 55
3 <null> 66
4 55 <null>
5 66 <null>
6 55 66
7 66 55
8 55 55
9 66 66
-- ===========
-- Requête N°1
-- ===========
select * from test where prefixe is null;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
2 <null> 55
3 <null> 66
select * from test where prefixe is not distinct from null;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
2 <null> 55
3 <null> 66
-- ===========
-- Requête N°2
-- ===========
select * from test where suffixe is null;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
4 55 <null>
5 66 <null>
select * from test where suffixe is not distinct from null;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
4 55 <null>
5 66 <null>
-- ===========
-- Requête N°3
-- ===========
select * from test where prefixe is null or prefixe <> 55;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
2 <null> 55
3 <null> 66
5 66 <null>
7 66 55
9 66 66
select * from test where prefixe is distinct from 55;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
2 <null> 55
3 <null> 66
5 66 <null>
7 66 55
9 66 66
-- ===========
-- Requête N°4
-- ===========
select * from test where suffixe is null or suffixe <> 55;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
3 <null> 66
4 55 <null>
5 66 <null>
6 55 66
9 66 66
select * from test where suffixe is distinct from 55;
ID PREFIXE SUFFIXE
============ ============ ============
1 <null> <null>
3 <null> 66
4 55 <null>
5 66 <null>
6 55 66
9 66 66
exit;
Appuyez sur une touche pour continuer... |
Partager