AnuKass
19th July 2018, 08:28
hii...
i'm new for LN ..
i want to get all details of particular field.,..
e.g i have 2 fields in xxx table..i want a,b under condition F1= 1 with in single
process Query..!!other language it is possible ..but in this script it read record by record .so it take 2 time but i want 1 time to execute a query..:confused:
F1 F2
1 a
1 b
3 c
4 d

Ajesh
19th July 2018, 12:01
In this also, if you give F1=1 the Query Processor will scan all records and then select the row for which F1=1, the same as other languages or DBMS.Not sure if it answers your query.

tmannais
19th July 2018, 12:05
Please show us your codes or what you have tried. So we can help more effectively.

JaapJD
19th July 2018, 14:41
If your use case is just about 1 or 2 records, you can code something like this:

domain tcitem item.1
domain tcitem item.2
domain tcorno orno

item.1 = ""
item.2 = ""
orno = "SOMEORDER"

select tdsls401.item:item.1, (select a.item from tdsls401 a where a.orno = tdsls401.orno and a.pono > tdsls401.pono):item.2
from tdsls401
where tdsls401.orno = :orno
as set with 1 rows
selectdo
endselect

message(sprintf$("Following items in order %s: %s %s %s", orno, trim$(item.1), (isspace(item.2) ? "" : "and"), trim$(item.2)))


If the number of records with the same key is undefined, I see no other option to process them one by one...