Results 1 to 3 of 3

Thread: Problem with SQL Query

  1. #1
    Join Date
    Dec 2003
    Posts
    6

    Problem with SQL Query

    This is a relatively simple problem and is probably easy, but you nether know that until someone tells you. I have written this query in SQL for use in Oracle:

    SELECT PropertyStreet,
    PropertyTown,
    PropertyCity,
    PropertyPostCode,
    WeeklyRentRate
    FROM PrivateLandlord
    WHERE PropertyStreet = Street
    ORDER BY WeeklyRentRate;

    It works but I want it to do the opposite thing. On the line where it says WHERE PropertyStreet = Street, that means that the PropertyStreet attribute has to have the same value as the Street attribute, so in the code you put an = between them, but I want them to be NOT equal, any ideas?

    Thanks,
    Darren

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Did u try

    SELECT PropertyStreet,
    PropertyTown,
    PropertyCity,
    PropertyPostCode,
    WeeklyRentRate
    FROM PrivateLandlord
    WHERE PropertyStreet not in (Street)
    ORDER BY WeeklyRentRate;

    or

    SELECT PropertyStreet,
    PropertyTown,
    PropertyCity,
    PropertyPostCode,
    WeeklyRentRate
    FROM PrivateLandlord
    WHERE PropertyStreet <> Street
    ORDER BY WeeklyRentRate;

  3. #3
    Join Date
    Dec 2003
    Posts
    181
    Try PropertyStreet <> Street

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •