Search Results

Search found 2 results on 1 pages for 'user363024'.

Page 1/1 | 1 

  • Help with Oracle SQL Count function! =)

    - by user363024
    Hi guys.. The question im struggling with is this: i have a list of helicopter names in different charters and i need to find out WHICH helicopter has the least amount of charters booked. Once i find that out i need to ONLY display the one that has the least. I so far have this: SELECT Helicopter_Name COUNT (Distinct Charter_NUM) FROM Charter_Table GROUP BY Helicopter Name ^ this is where i am stuck, i realise MIN could be used to pick out the value that is the smallest but i am not sure how to integrate this into the command. Something like Where MIN = MIN Value Id really appreciate it

    Read the article

  • Using NVL function in SQL, please help!

    - by user363024
    I'm needing to select first and last name in a table which is working fine in the following SQL, but the part that isn't working is the NVL function. The file should show all pilots at a company that fly helicopters and IF they don't have a licence the field HT_NAME should come up as 'N/A' and the field for end hours flown should be 0. I've put NVL function in as my text details but it still isn't working. Have i made a syntax error? Help would be appreciated. Select E.EMP_NBR, E.EMP_FIRSTNAME || ' ' || E.EMP_LASTNAME, E.EMP_PILOT, ED.HT_NBR, NVL(HT.HT_NAME, 'N/A'), NVL(ED.END_HRS_FLOWN, 0), ED.END_LAST_ANNUAL_REVIEW_DATE From ENDORSEMENT ED, EMPLOYEE E, HELICOPTER_TYPE HT WHERE HT.HT_NBR = ED.HT_NBR (+) ORDER BY ED.END_HRS_FLOWN DESC, E.EMP_FIRSTNAME || ' ' || E.EMP_LASTNAME ASC; should make employees who are not pilots appear with a N/A under heli type and 0 under hours flown. It isn't working - even though I have tried multiple things to repair it.

    Read the article

1