Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

oracle query

  • 19-02-2004 05:00PM
    #1
    Registered Users, Registered Users 2 Posts: 618 ✭✭✭


    I have to join 2 columns in the same table. The join has to be distinct as i want to put the result into a combo box. I have received the following error when i execute my sql statement. I am sorry for all programmers i know this is a database probs any suggestion please


    SQL> select DISTINCT(Street1) from Map Where Street1 != (select DISTINCT(Street2) from Map);



    select DISTINCT(Street1) from Map Where Street1 != (select DISTINCT(Street2) from Map)
    *
    ERROR at line 1:
    ORA-01427: single-row subquery returns more than one row


Comments

  • Registered Users, Registered Users 2 Posts: 19,396 ✭✭✭✭Karoma


    i'm tired and possibly completely missing the point, but
    select DISTINCT(Street1) from Map Where Street1 != Street2

    would work (?) .. it makes more comparisons (performance drop) ..but it's straight forward and works..

    although you say you want to "join" the two columns... that isn't a join. select column1,column2 ....


  • Registered Users, Registered Users 2 Posts: 618 ✭✭✭johnnyc


    Thanks very much that guery is right?


Advertisement