Text autocomplete with DISTINCT()

Hi,

I have a select field with the attached lookup:
SELECT DISTINCT(username) AS username FROM radacct ORDER BY username

As the number of username values grow I want to switch to text autocomplete but if i use the same lookup in it:
SELECT DISTINCT(username) AS username FROM radacct

It gives following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AS username = ‘’’ at line 1
select DISTINCT(username) AS username from radacct where (username) AS username = ‘’

Any hints?

Thanks,
xaled

Hi Xaled,
You can use Text-Autocomplete field with a DISTINCT SQL sentence in ScriptCase. Please follow these steps:

[SIZE=4]Example using Text-Autocomplete with a DISTINCT [/SIZE]
SQL Select Statement


SELECT DISTINCT(field) FROM table

Note: In your case the SQL sentence will be something like this: SELECT DISTINCT(username) FROM radacct.

Hi,

thanks for the quick reply.

unfortunately SELECT DISTINCT(username) FROM radacct does not work either.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘as sc_alias_0 = ‘’’ at line 1
select DISTINCT(username) as sc_alias_0 from radacct where (username) as sc_alias_0 = ‘’

Greetings,
xaled