20
Views
5
Comments
Data fetching
Application Type
Reactive

Hi All


I have below relation between tables,


 I need to fetch all the columns from request table and one two three from detail table, what I have is multiple records like for request id 1001 i have multiple records in master and detail master table.. but i need only the current one.


Thanks

Shivangi

2022-05-02 13-30-24
Brendan G

You only need one record from the "MasterDataDetail" table and all records it joins to?
You can sort by the MasterDataDetailId Desc and set the max records to 1.
That should give you the newest ("Current") MasterDataDetail record and anything it joins to

2019-03-12 12-28-20
Shivangi Thakur

for example , request table has 1 record, id = 1001, and in master table for it i have multiple records lets say id 112,114,116 against 1001.. and in details table as well i have multiple records against 112,114,116..let say 445,334,556

what i need is 1001, 112, 445 for all three tables 


2022-05-02 13-30-24
Brendan G

I think in that case you would need to use an advanced SQL and use a sub query.


Or possibly with an aggregate set to 1 record and sort by both MasterDataId Desc and MasterDataDetailId Desc

2019-03-12 12-28-20
Shivangi Thakur

I need to display a list of request  with all attributes of request table and some attributes of detail table .. that too for the current record only..

2024-12-02 13-16-47
Vipin Yadav

Hi @Shivangi Thakur ,

You can retrieve data by using an aggregate function, which allows you to join tables. To ensure you only get a single record, set the maximum number of records to one in the aggregate's properties. 

I have added below image for your reference.


Thanks,

Vipin Yadav

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.