Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am using a script like :
Temp1:
Load
A as aa,
B as bb
resident Temp_Table
where 0;
It truncating data from table. If I check data in Temp1, it is showing 0 records.
If I put where 1, then it is showing all records.
Is it something line where 1 means it will show first row only?
Please help me to understand the logic.
Thanks,
Sarif
Use First or RowNo() functions.
Try this way for your script
1. By First
First 1
Noconcatenate
Temp1:
Load
A as aa,
B as bb
resident Temp_Table;
2. By Rowno()
Noconcatenate
Temp1:
Load
A as aa,
B as bb
resident Temp_Table
Where RowNo() < 1;
This all loading only one row.
Hi,
1 means true. and
0 means false
to take read only 1 record you can use like
select top 1 * from tableNAme
or
First 1 Load * from tableNAme
navigate below thread
Regards
Hi,
I want to understand what is the difference between where 0 and where 1.
Where 0 means False value is passed to the Load statement and when using Where 1 it passes True to the load statement. I believe that is the only difference.
I am not very clear.
Could you please explain with my example.
Thanks in advance for your co operation.
Sarif
It is like using where 1=1
or where 1=0 in sql
Temp1:
Load
A as aa,
B as bb
resident Temp_Table
where 0;
is same as
Temp1:
Load
A as aa,
B as bb
resident Temp_Table
where 1=0;
The Where clause determines if the current input row will be included in the output table. If Where returns a true value, the row will be kept, if false the row will be discarded.
Where 0; // Always false, keep no rows
Where 1; // Always true, keep all rows
-Rob