TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mark Tabor
587
2k
459.9k
Getting Data from two tables
Jun 12 2016 11:28 AM
I have two tables one of USERS and second of UserFiles just like below
UserTable
UserId
Name
Email
Phone
1
New
[email protected]
0909000
2
Old
[email protected]
0998099
UserFiles
FileID(Primary)
UserID(Foreignkey)
FileName
DateCreated
Active
1
1
MyResume.Doc
2/2/2016
true
2
1
Image.JPG
2/17/2016
true
3
1
Cover.Docx
2/20/2016
true
4
2
Card.png
1/1/2017
true
Now I have a gridview I want to show one File for each user I mean the latest file for this user According to datecreated for example here I have three files for userid=1 but i just want to show the Cover.Docx because it is latest one for this user according to datecreated Field.
I want this record how to do that
RecordID
UserId
FileName
Email
Phone
1
1
Cover.Docx
[email protected]
0909000
2
2
card.png
[email protected]
0998099
I want that record how to achived that
Reply
Answers (
8
)
Using IF else statements in stored procedure
record not delete if id use another table in sql query