Oracle 从多条符合条件的记录中选择一条显示

SELECT
    ti.*
FROM
    (
        SELECT
            pt.*,
            ROW_NUMBER() OVER(
                PARTITION BY pt.test_item_name
                ORDER BY
                    pt.test_item_id
            ) row_id
        FROM
            t_procedure_test pt
        WHERE
            pt.model_code = '1001000058611'
    ) ti
WHERE
    row_id = 1;

posted @ 2019-04-01 14:59  hanje  阅读(2307)  评论(0编辑  收藏  举报