The CreatorCon Call for Content is officially open! Get started here.

Database view unique records

servicetrout
Tera Expert

I would like to create a database view with unique divisions from a table such as this:

[

dept1       div1     var_a

dept1       div1     var_b

dept1       div2     var_c

dept2       div1     var_d

dept2       div2     var_e

dept2       div2     var_f

dept2       div3     var_g

]

I want the view to look like this:

[

dept1     div1

dept1     div2

dept2     div1

dept2     div2

dept2     div3

]

After looking at the database view documentation, here

Specify a field to return

I couldn't figure out how to find the,   "View Field form" to restrict the variables returned ?

And, I couldn't see any way use a Where clause to make the set unique?

Any guidance would be appreciated.

-G

1 ACCEPTED SOLUTION

Database View is used to add two tables with a common field. I am not sure it will fulfill your requirement.


You can find "View Field form" when you defined a table.


find_real_file.png


find_real_file.png


View solution in original post

5 REPLIES 5

Deepak Kumar5
Kilo Sage

Not sure you are referring two different tables Department and division. If yes then you can try with connecting both table with a key and no table would be selected as left join..


Not two tables, just one table.     Trying to build a view from that one table, with a list of unique Departments / Division combinations.



Sorry, if that wasn't clear.


Database View is used to add two tables with a common field. I am not sure it will fulfill your requirement.


You can find "View Field form" when you defined a table.


find_real_file.png


find_real_file.png


It won't work for what I need but you have provided the answers to the questions.   Thank you.