DISTINCTROW equivalent in SQL Server
From reading the documentation on distinctrow, it looks like you want an exists clause or (for generally better performance) a join:
SELECT * FROM A
WHERE EXISTS(SELECT * FROM B WHERE B.a_id = A.a_id)
SELECT DISTINCT A.* FROM A
INNER JOIN B ON A.a_id = B.a_id
-- corrected, should be inner join here
MS-Access DISTINCTROW dosen't work anymore if linked tables a stored on SQL2008-Server
Let's stop talking about the syntax of a left-join in ms-access. Fact is that if the linked tables are views on sql-server 2000:
create view [companies] as
select * from [TabCompanies] where deleted = 0
and
create view [contacts] as
select * from [TabContcts] where deleted = 0
These views are ODBC-linked-tables in a ms-access 2003/2007 mdb.
The questions shows up in ms-access on a query like
select distinctrow [companies].* from [companies] left join [contacts] on [companies].com_uid = contacts.com_uid] where [contacts].[function] like 'C*'
(lets forget that alternative syntax and look on the result assuming that the left join works without an error or syntaxerror)
This DISTINCTROW is a ms-access feature and not know in sql-server and for my point of view the result is the same like DISTINCT but works also even if there are columns with datatype of images par example.
All together we expect by now the same like Catcall in his answer said "select * from companies" BUT IT IS NOT, why?
This is only an excerpt of the whole query and may be makes no sense for production but it shows the changed behaviour wehn sql2008 is connected.
What is the equivalent to Access' 'SELECT DISTINCTROW * FROM...' in SQLite?
SELECT DISTINCT * FROM table WHERE column = value ORDER BY column2;
Since there's only one table involved, DISTINCTROW
acts like DISTINCT
.
MS-Access SQL DISTINCT GROUP BY
This should work:
SELECT DISTINCT GroupNumber, FirstNames
FROM Example AS b
how to use distinct in ms access
Okay.Its working this way.
SELECT DISTINCT Task.Priority, Task.Subject, Task.Status, Task.DueDate,
Task.Completed, Categories.Category
FROM Task, Categories
WHERE (((Categories.CategoryID)=[Task].[CategoryID]));
Related Topics
Fastest Way to Insert in Parallel to a Single Table
Understanding the Differences Between Cube and Rollup
How to Make a SQL Query for Last Transaction of Every Account
Is There an Agreed Ideal Schema for Tagging
Select * from Table1 That Does Not Exist in Table2 with Conditional
Delete Statement in SQL Is Very Slow
SQL Server:Get All String Occurences (Tags) from Nvarchar(Max) Variable Containing a JSON String
Get Table and Index Storage Size in SQL Server
What Is the Scala Type Mapping for All Spark SQL Datatype
Querying Where Condition to Character Length
Any Detailed and Specific Reasons for Why Mongodb Is Much Faster Than SQL Dbs
Inserting Data into a Temporary Table
Comma-Separated Value Insertion in SQL Server 2005