Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012

    Unanswered: questions from begener

    Hello little girls and wise boys!

    I've just finished my first degree studies and starded carier in analysis in Bank, in Poland. I don't have much practice in creatin SQL queries so I would like to ask here some elementary questions. I will be grateful if ya will help me to solve the problemos.

    Can ya tell me how to choose only one record, with maximum date. I wrote this:

    select a.*
    from tabela as a
    where (select max(date)
    from tabela as b
    where a.ID = b.ID)
    but this doesn't work

    also doesn't work
    select *
    from tabela
    where rownum <2

    I work in SAS Guide, in proc SQL

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    SELECT employee_id 
    FROM   employees 
    WHERE  hire_date = (SELECT Max(hire_date) 
                        FROM   employees) 
           AND rownum = 1;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Tags for this Thread

Posting Permissions

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