-
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
-
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;
-
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
-
Forum Rules
|
|