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
Ajay Mavatkar
NA
68
12.4k
query for filtering based on condition
May 31 2017 3:48 AM
Hi,
I have data following like this
Col1
Col2
Col3
Col4
Col5
Col7
1
19
test1
NY
F
NULL
1
19
test1
NY
F
NULL
2
87
test2
NY
F
9999778876
3
92
test3
NY
F
7766887765
4
70
test4
NY
M
NULL
4
70
test4
NY
M
3344556765
5
22
test5
HI
M
8899775544
I want to display distinct data
For eg Col1 has some multiple records and I need to display any one record when Col7 is null.
If Col7 is not null then I have to display record in which col7 is not null as follows
Col1
Col2
Col3
Col4
Col5
Col7
1
19
test1
NY
F
NULL
2
87
test2
NY
F
9999778876
3
92
test3
NY
F
7766887765
4
70
test4
NY
M
3344556765
5
22
test5
HI
M
8899775544
How to achieve this query
Reply
Answers (
3
)
Write a query to fetch values in table test_a that are an
Creating package in SSIS for XML file to store data in DB.