Skip to content
Loading
  • SreeRam Kondagorla
    0
    please check my code...
    0
  • Nitin Sontakke
    0
    Looks good to me. Are you getting expected result? If not, please post what you expect.
    0
  • SreeRam Kondagorla
    0
    Hi Sir...please check that i want album name,and first image of that album and created date,created by only...thanks
    0
  • Nitin Sontakke
    0
    Got it. But do you have a DateTime column or just the Date column. 
     
    If you only have Date column, which has no time in it, it will be very difficult.
    0
  • SreeRam Kondagorla
    0
    if i have date time column column then how can i get that please tell me..thanks...
    0
  • Ananth G
    0
    Table1 have Id or not?
    0
  • Nitin Sontakke
    0
    On what basis you are saying "first" image. That is very important. If you had date time column in that table, it is simple.
     
    There must be some criteria to identity "first" image for every album.
    0
  • Ananth G
    0
    1. Select a.Albumname,a.CreatedBy,a.Date,b.Description,b.ImgInfo from SecondTable a left join  (SELECT AlbumName,max(ImgInfo) as ImgInfo FROM FirstTable  group by  AlbumName) b on a.Albumname=b.Albumname ;  
    0
  • Nitin Sontakke
    0
    Just in case it is not clear to you, Ananth has given a solution to you which is sorting image file name alphabetically and taking the top one as a first one.
    0
  • Khaja Moizuddin
    0
    You can use joins concept like inner join to perform your operation...
    0
  • Pravat Kumar
    0
    select AlbumName,date,createdBy,imgInfo from(select ai.AlbumName,date,createdBy,imgInfo
    ,ROW_NUMBER() OVER (
    PARTITION BY
    ai.AlbumName ORDER BY Date
    ) AS RowNumber from AlbInfo ai
    JOIN Upload u ON ai.AlbumName=u.AlbumName)x where RowNumber=1
    0