How do I avoid duplicate result in an Auto Complete field?

(3 posts) (2 voices)
  1. aescripts, Member

    I am successfully getting Auto Complete to work but it shows duplicates, is there a way to not show dups?

    Here is my procedure:

    create procedure sp_Autoc_DBR_ScriptName( inItemName varchar(255) )
    begin select item_name from mydatabase.mytable
    where item_name like concat( '%', inItemName, '%'); end

    Thanks

  2. myDBR Team, Key Master

    You have duplicate item_name values in your mytable? You can use SQL distinct clause do remove the duplicates.

    create procedure sp_Autoc_DBR_ScriptName( inItemName varchar(255) )
    begin select distinct item_name
    from mydatabase.mytable
    where item_name like concat( '%', inItemName, '%'); end

    --
    myDBR Team

  3. aescripts, Member

    Yes, it's a raw sales database so everytime an item is sold it is entered into the database. Your solution worked, thanks.


Reply

You must log in to post.