A
|
alang 7/7/2009 |
Is it possible to avoid putting duplicates in the table in the first place using unique index? |
D
|
dblack6047 author 7/7/2009 |
Is it possible to avoid putting duplicates in the table in the first place using unique index?
|
![]() |
Sergey Kornilov admin 7/7/2009 |
I think it's a matter of adding DISTINCT to SQL query on the export page. if (substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1)=="Cars_export.php") $gsqlHead="SELECT DISTINCT ID, Make, Model, YearOfMake, Horsepower, EPACity, EPAHighway, Price"; |
D
|
dblack6047 author 7/7/2009 |
I think it's a matter of adding DISTINCT to SQL query on the export page. Here is the sample code that you can place to 'After table initialized' event:
|
![]() |
Sergey Kornilov admin 7/7/2009 |
When you open 'After table initialized' event in event editor you can see a hint area with variables like $gsqlHead. |
D
|
dblack6047 author 7/8/2009 |
Unfortunately DISTINCT is not working as I have far more than 20 fields and I am only wanting DISTINCT on the MD5 field which I have named in my database table as "Hash_Value". To use DISTINCT I would have to create a more cpu intensive, lengthy and complicated command such as using SELECT MAX (Name), MAX (File_Size), Hash_Value, MAX (Created_Date), MAX (Written_Date) etc. etc and then GROUP BY at the tail end. |
![]() |
Sergey Kornilov admin 7/8/2009 |
If you think GROUP BY gives you better results than DISTINCT you should definitely proceed that way. |
D
|
dblack6047 author 7/8/2009 |
I've spent last night and this morning looking at the event hints but I cannot find the exact title lines that I need for each sql statement. I mean I have the following that I listed above: |
![]() |
Sergey Kornilov admin 7/8/2009 |
dblack6047, |
D
|
dblack6047 author 9/15/2009 |
Sergey, |