We have a SQL database table recording customer comments (ARCMM). I want to extract the most recent comment for each customer. Some customers do not have any comments (i.e. no entries in ARCMM). The most recent comment for a customer will have the most recent date (field DATEENTR) and, for that date, the highest value of field CNTUNIQ. The query
Tag: nested-query
how to write select query in PostgreSQL to iterate over an array which is returned by a select query
SELECT b_items_p_id FROM public.box WHERE b_id =1 and this is what it returns: {1,3,5} Now on each of these value, i.e., 1, 3 and 5 I want to run another select query: select p_desc from public….