Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

sql query question

  • 24-01-2007 10:25AM
    #1
    Registered Users, Registered Users 2 Posts: 1,072 ✭✭✭


    hi guys
    i am wondering why the last line of code in the example below is neccessary
    thanks ed

    5) Write the SQL script to determine how many years an employee has worked
    in the company (emp table)

    Select ename "Name", hiredate ,round((months_between(sysdate,hiredate))/12) "Years in company"
    From emp
    Where ename = ‘&Name’;


Comments

  • Registered Users, Registered Users 2 Posts: 6,176 ✭✭✭Idleater


    hi guys
    i am wondering why the last line of code in the example below is neccessary
    thanks ed

    5) Write the SQL script to determine how many years an employee has worked
    in the company (emp table)

    Select ename "Name", hiredate ,round((months_between(sysdate,hiredate))/12) "Years in company"
    From emp
    Where ename = ‘&Name’;

    if you are talking about Where ename = ‘&Name’, then it should be retrieving the row that corresponds to the employee name that you pass in in the variable Name.

    eg where ename='jimmy murphy'

    L.


Advertisement