I have a table as follows:
Id = stretch(1..100,1000)
area = take(`A`B`C`D`E`F`G`H`I`J,1000)
qyt = rand(100.00,1000)
t = table(Id,area,qyt)
I want to query data with multiple field values.
Query condition:
- field value “Id=1“, “area“ = A, F, G;
- field value “Id=2“, “area“ = B, C, D;
- field value “Id=3“, “area“ = B, C, G;
I tried the following method, querying each record with a where clause.
select * from t where (Id =1 and area = `A) or (Id = 1 and area = `F) or(Id = 1 and area = `G)
The code is simple but long. Is there any easier way to solve this problem?