Generates a Select Statement
sql_gen_select(
select_fields,
table,
where_fields = names(where_values),
where_values = NULL,
group_by = c(),
order_by = c(),
top = 0,
distinct = FALSE
)
The fields to be selected
The table to be used in the select
The fields used in the where section
The values used in the where section
Group by fields
Order by fields
Retrieve top records
it adds a distinct clause to the query.
ken4rab