Q:

Better way of doing what I'm trying to do?

I'm new to SQL and I need some help. I need to sort certain columns by descending order and only get the top columns. My main concern is the SELECT *, I think that could lead to performance issues. Another concern is that this method leaves an extraneous ROW_NUMBER column that I ultimately don't need but my SQL isn't valid unless I include that column.
INSERT INTO
  FNL_PROF_BID_ID_W2 ( 
    CUST_ORD_NBR,
    STR_LOC_ID,
    PROF_BID_ID,
    ROW_NUMBER )
SELECT
  *
FROM (
  SELECT
    PB.CUST_ORD_NBR,
    PB.LOC_NBR,
    PB.PROF_BID_ID AS PROF_BID_ID,
    ROW_NUMBER() OVER(PARTITION BY PB.CUST_ORD_NBR, PB.LOC_NBR ORDER BY PB.PROF_BID_ID DESC, PB.CRT_TS DESC) AS ROW_NUMBER
  FROM
    PROF_BID PB )
WHERE
  ROW_NUMBER = 1

A:

ROW_NUMBER() is a fine way to solve this problem.  In some cases, you can get better performance using:
INSERT INTO FNL_PROF_BID_ID_W2 (CUST_ORD_NBR, STR_LOC_ID, PROF_BID_ID)
    SELECT PB.CUST_ORD_NBR, PB.LOC_NBR, PB.PROF_BID_ID
    FROM PROF_BID PB
    WHERE PB.PROF_BID_ID = (SELECT MAX(PB2.PROF_BID_ID)
                            FROM PROF_BID PB
                            WHERE PB2.CUST_ORD_NBR = PB.CUST_ORD_NBR AND PB2.LOC_NBR = PB.LOC_NUMBER
                          );

This assumes that PROF_BID_ID is unique, meaning that you don't need the second key to uniquely identify a row (that seems reasonable given the naming conventions).
In particular, this can take optimal advantage of an index on (CUST_ORD_NBR, LOC_NUMBER, PROF_BID_ID).
I should emphasize, though, that nothing is wrong with using ROW_NUMBER() for this purpose.
It may also be sufficient to do:
INSERT INTO FNL_PROF_BID_ID_W2 (CUST_ORD_NBR, STR_LOC_ID, PROF_BID_ID)
    SELECT PB.CUST_ORD_NBR, PB.LOC_NBR, MAX(PB.PROF_BID_ID)
    FROM PROF_BID PB
    GROUP BY PB.CUST_ORD_NBR, PB.LOC_NBR;

