Topics Topics Help/Instructions Help Edit Profile Profile Member List Register Paatha Gnyapakaalu - Archives from Old DB  
Search New Posts 1 | 2 | 8 Hours Search New Posts 1 | 3 | 7 Days Search Search Tree View Tree View Latest tweets Live Tweets   Hide Images

Rate this post by selecting a number. 1 is the worst and 5 is the best.

    (Worst)    1    2    3    4    5     (Best)

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Ravanabrahma
Celebrity Bewarse
Username: Ravanabrahma

Post Number: 23331
Registered: 06-2004
Posted From: 99.67.74.174

Rating: N/A
Votes: 0

Posted on Wednesday, July 10, 2013 - 10:01 pm:   

I have the below query.

select vendor_name, address_line1, vendor_id
from table a, b
where
..
Union
select vendor_name, null as address_line1, vendor_id
from table x, y
where
..


Now I am getting the data like

Dell, 236 springcreek, 123
Dell, null, 123

If the result of the union query has multiple rows with the same vendor_id but one with null addressline, I don't want to get that record that has null addressline, if the query return only the null addressline record, then I want to display that.

How can I acheive this?

Topics | Last Hour | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration