SQL "Select" command

Discussion in 'ASP.NET / ASP.NET Core' started by brightmosquito, Jan 6, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 3 Databases. How can I display student's name with their event log time?

    Student:
    ID Name
    1John Feber
    2David Yoe


    Registration:
    ID Name StudentID
    1 Speech 2
    2Math 2

    EventLog:
    ID Time RegistrationID
    1 8:30:00AM 1
    2 9:00:00AM 2
     
  2. Hi Peter,

    That might be something like

     
  3. In this case, if I choose student.id = 2, there'll be 2 records. But I only need one record, how can I do it?
     
  4. What do you mean with one record ?


    You have 2 registrations for this student, with an eventlog for each registration, thus resulting in 2 records (one for each eventlog of the registration)


    If you need only 1 record, you can specify which event you want to see, or just do


    select top 1 Student.Name, Registration.Name, EventLog.Time


    --
    Steurm
    www.steurm.net/steurm
    [​IMG]
     
  5. got it. thanks
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page