What does sql_select="e.*" do?

by Eoin   Last Updated May 26, 2018 12:10 PM

On this page: https://docs.joomla.org/SQL_form_field_type

It talks about using the SQL field. But I'm wondering what

sql_select="e.*" do?

Does. I know that the star is a wildcard for everything. I'm just not sure what the e does (fist guess would be escape).

Can anyone fill me in?

Here is the full code:

<field
    name="example_group" 
    type="sql" 
    label="COM_EXAMPLE_GROUP" 
    sql_select="e.*" 
    sql_from="#__example AS e" 
    sql_group="name" 
    sql_order="e.id ASC" 
    key_field="id"
    value_field="name" 
    />


Answers 1


I guess the example you are talking about is this: "SELECT e.* FROM #__example AS e GROUP BY name ORDER e.id ASC"

Ths basically mean select everything from the table #__example (which has an alias name in the query of e) and group by name and order by id in ascending order.

if you didn't use AS e in the query you had to write the query as follows:

SELECT * from #__example GROUP BY ...

using AS e helps you save few characters to write when you do more complicated queries with a lot of joins etc.

You can check this resource for more beginner information on mysql: https://www.thegeekstuff.com/2013/09/mysql-select-command/

Daniel Dimitrov
Daniel Dimitrov
May 26, 2018 11:59 AM

Related Questions


Component's configuration: Save multiple values

Updated August 03, 2015 14:04 PM

Showon does not work in frontend

Updated March 28, 2016 08:04 AM

Form field "checkboxes" mutliple default values

Updated June 08, 2016 08:04 AM


Subform inside modal

Updated September 21, 2017 13:10 PM