Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    14

    Unanswered: how to connect these two tables?

    There is a table called emp:

    empno ename sal
    7698 scott 800
    ...



    another table called salgrade:
    grade losal hisal
    1 700 1200
    2 1200 1500
    ...

    now the question is what's the sql to display the empno with their grade?
    the result should be like:
    empno grade
    7698 1
    ...

    Can anyone help me???
    thanks!

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Something like this?
    Code:
    SELECT e.empno, s.grade
    FROM EMP e,SALGRADE s
    WHERE e.sal BETWEEN s.losal AND s.hisal;

  3. #3
    Join Date
    Mar 2004
    Posts
    14

    Smile thanks

    it works, thank you so much!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •