bravi
asked on
Equivalent to DISTINCTROW
What is the equivalent to DISTINCTROW keyword of Microsoft Access? DISTINCT is not an exact replacement.
There is only DISTINCT, can you give me an example where they are not equal. I think it is only down to how records are retrieved.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That definetly helps. I will give you the points. Thanks
I'm glad that worked. :)
Have been thinking on this,
an equivalent is to use the IN and a subquery i.e
SELECT DISTINCTROW Customers.CustomerName
FROM Customers
WHERE Customers.CustomerID IN (SELECT DISTINCT Orders.CustomerID
FROM Orders)
an equivalent is to use the IN and a subquery i.e
SELECT DISTINCTROW Customers.CustomerName
FROM Customers
WHERE Customers.CustomerID IN (SELECT DISTINCT Orders.CustomerID
FROM Orders)
I don't think that will do it.
I'm assuming you meant distinct instead of distinctrow in the main select.
If you have CustomerName = Bob, CustomerID = 1 and CustomerName = Bob, CustomerID = 5 you're still only going to get one Bob returned.
I'm assuming you meant distinct instead of distinctrow in the main select.
If you have CustomerName = Bob, CustomerID = 1 and CustomerName = Bob, CustomerID = 5 you're still only going to get one Bob returned.
Sorry remove the distinctrow completely, i think.
The essence is you don't want 4 rows if you have 4 orders, you only want one.
The essence is you don't want 4 rows if you have 4 orders, you only want one.