Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

sql query question

Options
  • 24-01-2007 10:25am
    #1
    Registered Users Posts: 1,073 ✭✭✭


    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 Posts: 6,236 ✭✭✭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