Re: SQL: getting data for a null value column ??




baka wrote:
> Thanks hrishy san (&)
> you are right in one way, but, i mentioned tabB is a master table
> so i have to take name from tabB only. if it not exists then,i have to
> take it from transaction table i.e tabB.
>
> o/p what i want is (without using union)
>
> 001 tabBbankname
> 002 secondbank
> 003 tabBthirdbank
> 004 fourthbank
> 005 Firstunionbank
>
> PS: about union
>
> SELECT a.bankcode,a.bankname
> FROM
> taba a,tabb b where a.bankcode=b.bbankcode(+)
> union
> SELECT b.bbankcode,b.bbankname
> FROM taba a,tabb b where b.bbankcode(+)=a.bankcode
>
> Thans Mr.Arun for reading my mail. but what..

[snip]

Please do not top post, thanks.

Given what you have written, I suspect you do not
understand what the UNION construct does.

Like 'Anurag' said, what's wrong with:

select * from taba;
etc...

?

The UNION construct in it's basic form will select *all*
distinct values.

Cheers,
Chris Val

.



Relevant Pages

  • Re: SQL: getting data for a null value column ??
    ... Thanks hrishy san ... so i have to take name from tabB only. ... PS: about union ... FROM taba a,tabb b where b.bbankcode=a.bankcode ...
    (comp.databases.oracle.server)
  • Re: View of two tables with same data
    ... Select * from taba ... union all ... select * from tabb ... Dave Ballantyne ...
    (microsoft.public.sqlserver.programming)
  • Re: Query Join no unique link
    ... NrSeq seems to be different but if you do not care about that then one ... Or you can just disregard the TabB. ... (yes the join fields are the same, but I don't have a unique link between ...
    (microsoft.public.sqlserver.programming)
  • Update TabA with value fromTabB
    ... TabA is a Detail Table, Col A belong to TabA ... TabB is a Header Table, ...
    (microsoft.public.sqlserver.programming)
  • Variables Update einer Tabelle
    ... ich habe schwierigkeiten eine Update-Klausel zu formulieren. ... Tabellen (TabA, TabB). ... Ich formuliers mal in Worten: ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)

Loading