mbeasley
05-15-2002, 06:35 AM
is there an SQL command to do the equivalent of MS Excel's " Unique records only' function?
|
View Full Version : SQL Command for MS Access mbeasley 05-15-2002, 06:35 AM is there an SQL command to do the equivalent of MS Excel's " Unique records only' function? Pat Hartman 05-15-2002, 07:28 AM There are two possible options that you can use. They are properties you can set for a query. You probably want to set UniqueValues to Yes. mbeasley 05-15-2002, 07:50 AM I should have specified that I am using a pass through query in this instance. I have my select, from, where and group by, but it is taking an abnormal amount of time to run and I am thinking I am going about things the wrong way. Any suggestions? Pat Hartman 05-15-2002, 05:59 PM You can try using the DISTINCT keyword it may work the same way in whatever RDBMS you are using as it does in Access SQL. However, if the query is taking too long, you should probable make sure that your join is correct. You may be inadvertantly forcing a cartesian product. If your selection criteria is against non-indexed columns, the query will require a full table scan or if you are using the Like operator (even against an indexed column), the query will require a full table scan. There are articles in the Microsoft knowledge base on how to optimize ODBC queries. But, to know how to optimize a pass through query, you'd need advice from an SQL manual for your specific RDBMS. |