@@ -189,13 +189,13 @@ After the installation is complete, run `C:\TDengine\taosd.exe` to start TDengin
...
@@ -189,13 +189,13 @@ After the installation is complete, run `C:\TDengine\taosd.exe` to start TDengin
<TabItemlabel="macOS"value="macos">
<TabItemlabel="macOS"value="macos">
After the installation is complete, double-click the /applications/TDengine to start the program, or run `launchctl start taosd` to start TDengine Server.
After the installation is complete, double-click the /applications/TDengine to start the program, or run `launchctl start com.tdengine.taosd` to start TDengine Server.
The following `launchctl` commands can help you manage TDengine service:
The following `launchctl` commands can help you manage TDengine service:
@@ -675,7 +675,7 @@ To prevent system resource from being exhausted by multiple concurrent streams,
...
@@ -675,7 +675,7 @@ To prevent system resource from being exhausted by multiple concurrent streams,
| Meaning | Whether to generate core file when server crashes |
| Meaning | Whether to generate core file when server crashes |
| Value Range | 0: false, 1: true |
| Value Range | 0: false, 1: true |
| Default Value | 1 |
| Default Value | 1 |
| Note | The core file is generated under root directory `systemctl/launchctl start taosd` is used to start, or under the working directory if `taosd` is started directly on Linux/macOS Shell. |
| Note | The core file is generated under root directory `systemctl start taosd`/`launchctl start com.tdengine.taosd` is used to start, or under the working directory if `taosd` is started directly on Linux/macOS Shell. |
@@ -181,7 +181,7 @@ To make full use of the characteristics of time-series data, TDengine splits the
...
@@ -181,7 +181,7 @@ To make full use of the characteristics of time-series data, TDengine splits the
For time-series data, there is generally a retention policy, which is determined by the system configuration parameter `keep`. Data files exceeding this set number of days will be automatically deleted by the system to free up storage space.
For time-series data, there is generally a retention policy, which is determined by the system configuration parameter `keep`. Data files exceeding this set number of days will be automatically deleted by the system to free up storage space.
Given `duration` and `keep` parameters, the total number of data files in a vnode is: keep/duration. The total number of data files should not be too large or too small. 10 to 100 is appropriate. Based on this principle, reasonable `duration` can be set. In the current version, parameter `keep` can be modified, but parameter `duration` cannot be modified once it is set.
Given `duration` and `keep` parameters, the total number of data files in a vnode is: round up of (keep/duration+1). The total number of data files should not be too large or too small. 10 to 100 is appropriate. Based on this principle, reasonable `duration` can be set. In the current version, parameter `keep` can be modified, but parameter `duration` cannot be modified once it is set.
In each data file, the data of a table is stored in blocks. A table can have one or more data file blocks. In a file block, data is stored in columns, occupying a continuous storage space, thus greatly improving the reading speed. The size of file block is determined by the system parameter `maxRows` (the maximum number of records per block), and the default value is 4096. This value should not be too large or too small. If it is too large, data location for queries will take a longer time. If it is too small, the index of data block is too large, and the compression efficiency will be low with slower reading speed.
In each data file, the data of a table is stored in blocks. A table can have one or more data file blocks. In a file block, data is stored in columns, occupying a continuous storage space, thus greatly improving the reading speed. The size of file block is determined by the system parameter `maxRows` (the maximum number of records per block), and the default value is 4096. This value should not be too large or too small. If it is too large, data location for queries will take a longer time. If it is too small, the index of data block is too large, and the compression efficiency will be low with slower reading speed.
TDengine is a high-efficient, scalable, high-available distributed time-series database, which makes a lot of optimizations on inserting and querying data, which is far more efficient than normal regular databases. So TDengine can meet the high requirements of IOT and other areas on storing and querying a large amount of data.
TDengine is a high-efficient, scalable, high-available distributed time-series database, which makes a lot of optimizations on inserting and querying data, which is far more efficient than normal regular databases. So TDengine can meet the high requirements of IOT and other areas on storing and querying a large amount of data.
To configure TDengine : edit /etc/taos/taos.cfg
To configure TDengine : edit /etc/taos/taos.cfg
To start service : launchctl start taosd
To start service : launchctl start com.tdengine.taosd
sql create stable sta (ts timestamp, f1 int, f2 binary(10), f3 bool) tags(t1 int, t2 bool, t3 binary(10));
sql create table tba1 using sta tags(0, false, '0');
sql create table tba2 using sta tags(1, true, '1');
sql create table tba3 using sta tags(null, null, '');
sql create table tba4 using sta tags(1, false, null);
sql create table tba5 using sta tags(3, true, 'aa');
sql insert into tba1 values ('2022-09-26 15:15:01', 0, "a", false);
sql insert into tba1 values ('2022-09-26 15:15:02', 1, "0", true);
sql insert into tba1 values ('2022-09-26 15:15:03', 5, "5", false);
sql insert into tba1 values ('2022-09-26 15:15:04', null, null, null);
sql insert into tba2 values ('2022-09-27 15:15:01', 0, "a", false);
sql insert into tba2 values ('2022-09-27 15:15:02', 1, "0", true);
sql insert into tba2 values ('2022-09-27 15:15:03', 5, "5", false);
sql insert into tba2 values ('2022-09-27 15:15:04', null, null, null);
sql insert into tba3 values ('2022-09-28 15:15:01', 0, "a", false);
sql insert into tba3 values ('2022-09-28 15:15:02', 1, "0", true);
sql insert into tba3 values ('2022-09-28 15:15:03', 5, "5", false);
sql insert into tba3 values ('2022-09-28 15:15:04', null, null, null);
sql insert into tba4 values ('2022-09-29 15:15:01', 0, "a", false);
sql insert into tba4 values ('2022-09-29 15:15:02', 1, "0", true);
sql insert into tba4 values ('2022-09-29 15:15:03', 5, "5", false);
sql insert into tba4 values ('2022-09-29 15:15:04', null, null, null);
sql insert into tba5 values ('2022-09-30 15:15:01', 0, "a", false);
sql insert into tba5 values ('2022-09-30 15:15:02', 1, "0", true);
sql insert into tba5 values ('2022-09-30 15:15:03', 5, "5", false);
sql insert into tba5 values ('2022-09-30 15:15:04', null, null, null);
print ======== case when xx
sql select case when 3 then 4 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 4 then
return -1
endi
if $data10 != 4 then
return -1
endi
if $data20 != 4 then
return -1
endi
if $data30 != 4 then
return -1
endi
sql select case when 0 then 4 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when null then 4 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when 1 then 4+1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 5.000000000 then
return -1
endi
if $data10 != 5.000000000 then
return -1
endi
if $data20 != 5.000000000 then
return -1
endi
if $data30 != 5.000000000 then
return -1
endi
sql select case when 1-1 then 0 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when 1+1 then 0 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 0 then
return -1
endi
if $data20 != 0 then
return -1
endi
if $data30 != 0 then
return -1
endi
sql select case when 1 then 1-1+2 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 2.000000000 then
return -1
endi
if $data10 != 2.000000000 then
return -1
endi
if $data20 != 2.000000000 then
return -1
endi
if $data30 != 2.000000000 then
return -1
endi
sql select case when 1 > 0 then 1 < 2 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data30 != 1 then
return -1
endi
sql select case when 1 > 2 then 1 < 2 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when abs(3) then abs(-1) end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data30 != 1 then
return -1
endi
sql select case when abs(1+1) then abs(-1)+abs(3) end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 4.000000000 then
return -1
endi
if $data10 != 4.000000000 then
return -1
endi
if $data20 != 4.000000000 then
return -1
endi
if $data30 != 4.000000000 then
return -1
endi
sql select case when 0 then 1 else 3 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 3 then
return -1
endi
if $data10 != 3 then
return -1
endi
if $data20 != 3 then
return -1
endi
if $data30 != 3 then
return -1
endi
sql select case when 0 then 1 when 1 then 0 else 3 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 0 then
return -1
endi
if $data20 != 0 then
return -1
endi
if $data30 != 0 then
return -1
endi
sql select case when 0 then 1 when 1 then 0 when 2 then 3 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 0 then
return -1
endi
if $data20 != 0 then
return -1
endi
if $data30 != 0 then
return -1
endi
sql select case when 'a' then 'b' when null then 0 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when '2' then 'b' when null then 0 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != b then
return -1
endi
if $data10 != b then
return -1
endi
if $data20 != b then
return -1
endi
if $data30 != b then
return -1
endi
sql select case when 0 then 'b' else null end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when 0 then 'b' else 2 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 2 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data20 != 2 then
return -1
endi
if $data30 != 2 then
return -1
endi
sql select case when sum(2) then sum(2)-sum(1) end from tba1;
if $rows != 1 then
return -1
endi
if $data00 != 4.000000000 then
return -1
endi
sql select case when sum(2) then abs(-2) end from tba1;
if $rows != 1 then
return -1
endi
if $data00 != 2 then
return -1
endi
sql select case when ts then ts end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != @22-09-26 15:15:01.000@ then
return -1
endi
if $data10 != @22-09-26 15:15:02.000@ then
return -1
endi
if $data20 != @22-09-26 15:15:03.000@ then
return -1
endi
if $data30 != @22-09-26 15:15:04.000@ then
return -1
endi
sql select case when f1 then ts end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != @22-09-26 15:15:02.000@ then
return -1
endi
if $data20 != @22-09-26 15:15:03.000@ then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when f1 then f1 when f1 + 1 then f1 + 1 else f1 is null end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 5 then
return -1
endi
if $data30 != 1 then
return -1
endi
sql select case when f1 then 3 when ts then ts end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1664176501000 then
return -1
endi
if $data10 != 3 then
return -1
endi
if $data20 != 3 then
return -1
endi
if $data30 != 1664176504000 then
return -1
endi
sql select case when 3 then f1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 5 then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case when f1 then 3 when 1 then 2 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 2 then
return -1
endi
if $data10 != 3 then
return -1
endi
if $data20 != 3 then
return -1
endi
if $data30 != 2 then
return -1
endi
sql select case when sum(f1) then sum(f1)-abs(-1) end from tba1;
if $rows != 1 then
return -1
endi
if $data00 != 5.000000000 then
return -1
endi
sql select case when sum(f1) then sum(f1)-abs(f1) end from tba1 group by f1 order by f1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != 0.000000000 then
return -1
endi
if $data30 != 0.000000000 then
return -1
endi
sql select case when f1 then sum(f1) when f1 is not null then 9 else 8 end from tba1 group by f1 order by f1;
if $rows != 4 then
return -1
endi
if $data00 != 8 then
return -1
endi
if $data10 != 9 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data30 != 5 then
return -1
endi
sql select f1 from tba1 where f1 > case when f1 then 0 else 3 end;
if $rows != 2 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 5 then
return -1
endi
sql select f1 from tba1 where ts > case when ts then ts end;
if $rows != 0 then
return -1
endi
sql select sum(f1),count(f1) from tba1 partition by case when f1 then f1 when 1 then 1 end;
if $rows != 2 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data10 != 5 then
return -1
endi
if $data11 != 1 then
return -1
endi
sql select case when f1 < 3 then 1 when f1 >= 3 then 2 else 3 end caseWhen, sum(f1),count(f1) from tba1 group by case when f1 < 3 then 1 when f1 >= 3 then 2 else 3 end order by caseWhen;
if $rows != 3 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 2 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data11 != 5 then
return -1
endi
if $data12 != 1 then
return -1
endi
if $data20 != 3 then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data22 != 0 then
return -1
endi
sql select f1 from tba1 order by case when f1 <= 0 then 3 when f1 = 1 then 4 when f1 >= 3 then 2 else 1 end desc;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 0 then
return -1
endi
if $data20 != 5 then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select cast(case f1 when f1 then f1 + 1 else f1 is null end as double) from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1.000000000 then
return -1
endi
if $data10 != 2.000000000 then
return -1
endi
if $data20 != 6.000000000 then
return -1
endi
if $data30 != 1.000000000 then
return -1
endi
sql select sum(case f1 when f1 then f1 + 1 else f1 is null end + 1) from tba1;
if $rows != 1 then
return -1
endi
if $data00 != 14.000000000 then
return -1
endi
sql select case when f1 < 3 then 1 when f1 >= 3 then 2 else 3 end,sum(f1),count(f1) from tba1 state_window(case when f1 < 3 then 1 when f1 >= 3 then 2 else 3 end);
if $rows != 3 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 2 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data11 != 5 then
return -1
endi
if $data12 != 1 then
return -1
endi
if $data20 != 3 then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data22 != 0 then
return -1
endi
sql select f1 from tba1 where case when case when f1 <= 0 then 3 when f1 = 1 then 4 when f1 >= 3 then 2 else 1 end > 2 then 1 else 0 end > 0;
if $rows != 2 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 1 then
return -1
endi
sql select case when f1 is not null then case when f1 <= 0 then f1 else f1 * 10 end else -1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 10 then
return -1
endi
if $data20 != 50 then
return -1
endi
if $data30 != -1 then
return -1
endi
print ======== case xx when xx
sql select case 3 when 3 then 4 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 4 then
return -1
endi
if $data10 != 4 then
return -1
endi
if $data20 != 4 then
return -1
endi
if $data30 != 4 then
return -1
endi
sql select case 3 when 1 then 4 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case 3 when 1 then 4 else 2 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 2 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data20 != 2 then
return -1
endi
if $data30 != 2 then
return -1
endi
sql select case 3 when null then 4 when '3' then 1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data30 != 1 then
return -1
endi
sql select case '3' when null then 4 when 3 then 1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data30 != 1 then
return -1
endi
sql select case null when null then 4 when 3 then 1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != NULL then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case 3.0 when null then 4 when '3' then 1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data30 != 1 then
return -1
endi
sql select case f2 when 'a' then 4 when '0' then 1 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 4 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case f2 when f1 then f1 when f1 - 1 then f1 else 99 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 0 then
return -1
endi
if $data10 != 1 then
return -1
endi
if $data20 != 5 then
return -1
endi
if $data30 != 99 then
return -1
endi
sql select case cast(f2 as int) when 0 then f2 when f1 then 11 else ts end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != a then
return -1
endi
if $data10 != 0 then
return -1
endi
if $data20 != 11 then
return -1
endi
if $data30 != 1664176504 then
return -1
endi
sql select case f1 + 1 when 1 then 1 when 2 then 2 else 3 end from tba1;
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 2 then
return -1
endi
if $data20 != 3 then
return -1
endi
if $data30 != 3 then
return -1
endi
sql select case f1 when sum(f1) then sum(f1)-abs(f1) end from tba1 group by f1 order by f1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != 0.000000000 then
return -1
endi
if $data20 != 0.000000000 then
return -1
endi
if $data30 != 0.000000000 then
return -1
endi
sql select f1, case sum(f1) when 1 then f1 + 99 when f1 then f1 -99 else f1 end from tba1 group by f1 order by f1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data01 != NULL then
return -1
endi
if $data10 != 0 then
return -1
endi
if $data11 != -99.000000000 then
return -1
endi
if $data20 != 1 then
return -1
endi
if $data21 != 100.000000000 then
return -1
endi
if $data30 != 5 then
return -1
endi
if $data31 != -94.000000000 then
return -1
endi
sql select case when 3 then 4 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 0 then 4 end from sta;
if $rows != 20 then
return -1
endi
sql select case when null then 4 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 1 then 4+1 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 1-1 then 0 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 1+1 then 0 end from sta;
if $rows != 20 then
return -1
endi
sql select case when abs(3) then abs(-1) end from sta;
if $rows != 20 then
return -1
endi
sql select case when abs(1+1) then abs(-1)+abs(3) end from sta;
if $rows != 20 then
return -1
endi
sql select case when 0 then 1 else 3 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 0 then 1 when 1 then 0 else 3 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 0 then 1 when 1 then 0 when 2 then 3 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 'a' then 'b' when null then 0 end from sta;
if $rows != 20 then
return -1
endi
sql select case when '2' then 'b' when null then 0 end from sta;
if $rows != 20 then
return -1
endi
sql select case when 0 then 'b' else null end from sta;
if $rows != 20 then
return -1
endi
sql select case when 0 then 'b' else 2+abs(-2) end from sta;
if $rows != 20 then
return -1
endi
sql select case 3 when 3 then 4 end from sta;
if $rows != 20 then
return -1
endi
sql select case 3 when 1 then 4 end from sta;
if $rows != 20 then
return -1
endi
sql select case 3 when 1 then 4 else 2 end from sta;
if $rows != 20 then
return -1
endi
sql select case 3 when null then 4 when '3' then 1 end from sta;
if $rows != 20 then
return -1
endi
sql select case null when null then 4 when 3 then 1 end from sta;
if $rows != 20 then
return -1
endi
sql select case 3.0 when null then 4 when '3' then 1 end from sta;
if $rows != 20 then
return -1
endi
sql select f2,case f2 when 'a' then 4 when '0' then 1 end from sta order by f2;
if $rows != 20 then
return -1
endi
sql select f2,f1,case f2 when f1 then f1 when f1 - 1 then f1 else 99 end from sta order by f2;
if $rows != 20 then
return -1
endi
sql select case cast(f2 as int) when 0 then f2 when f1 then 11 else ts end from sta;
if $rows != 20 then
return -1
endi
sql select f1, case f1 + 1 when 1 then 1 when 2 then 2 else 3 end from sta order by f1;
if $rows != 20 then
return -1
endi
sql select case f1 when sum(f1) then sum(f1)-abs(f1) end from sta group by f1 order by f1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != 0.000000000 then
return -1
endi
if $data20 != NULL then
return -1
endi
if $data30 != NULL then
return -1
endi
sql select case sum(f1) when 1 then f1 + 99 when f1 then f1 -99 else f1 end from sta group by f1 order by f1;
if $rows != 4 then
return -1
endi
if $data00 != NULL then
return -1
endi
if $data10 != -99.000000000 then
return -1
endi
if $data20 != 1.000000000 then
return -1
endi
if $data30 != 5.000000000 then
return -1
endi
sql select distinct tbname, case t1 when t2 then t1 else t1 + 100 end from sta order by tbname;
if $rows != 5 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data21 != NULL then
return -1
endi
if $data31 != 101 then
return -1
endi
if $data41 != 103 then
return -1
endi
sql_error select case when sum(f1) then sum(f1)-abs(f1) end from tba1;