私は何かに苦しんでいて、自分でそれを理解する時間があまりありません。
私のクエリ:
Select distinct d.delivery_bay_code,dt.diary_type_desc, d.delivery_datetime, ddo.order_no , ddo.company_id_no, ddo.no_of_cartons, s.supplier_name, c.company_name, sk.sku_desc, (pod.deliver_not_after_date)||' '||(pod.deliver_not_before_date)as delivery_window
from diary d , dc_diary_order ddo , purch_order po ,purch_order_carton_sku pocs ,sku sk, purch_order_date pod,supplier s , diary_type dt , company c
where ddo.diary_entry_id_no = d.diary_entry_id_no
and po.order_no = ddo.order_no
and po.company_id_no = ddo.company_id_no
and s.supplier_id_no = po.supplier_id_no
and s.company_id_no = po.company_id_no
and dt.diary_type_code = d.diary_type_code
and c.company_id_no = po.company_id_no
and po.order_no = pocs.order_no
and pocs.sku_id_no = sk.sku_id_no
and po.company_id_no = 2
and ddo.order_no = 1999
order by delivery_datetime;
このクエリは、 のみがdelivery_window
異なる 2 つのレコードを返します。たとえば13/APR/11 13/APR/11 and 12/APR/11 12/APR/11
、最大の日時(最新の日付)のみを戻すようにします。
例えば:select max(delivery_datetime) from diary;
今、私は上記のクエリを次のように試しました:
select... max(pod.deliver_not_after_date)||' '||(pod.deliver_not_before_date)as delivery_window ... from
しかし、私はエラーが発生しますORA-00937: not a single-group group function