This topic is locked

Bad sql generated by vidual editor

4/22/2008 5:06:51 AM
PHPRunner General questions
S
steveh author

I've a dropdown that looks up the value in another table, but it's not a real "lookup" as such, it's just a list of unique values.
As the list is dynamic I want it from the database and not from a static list.
I've selected fielda as both the link field and the display field and I need to order by this as well, the generated sql looks like this:
select distinct fielda,fielda from table order by fielda
the order by can't be resolved as the name is not unique.
The easy fix would be to use the number as an order
select distinct fielda,fielda from table order by 1
Or just to select a single copy of the field?

J
Jane 4/22/2008

Steve,
create view in the database.

Here is a sample:

create view select fielda

from table

order by fielda


And then use this view as lookup table in the PHPRunner.