Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

oracle query

  • 19-02-2004 4: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