Home » U++ Library support » U++ SQL » SqlArray::SetDistinct()
SqlArray::SetDistinct() [message #7410] |
Wed, 27 December 2006 23:45 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
I'd like to propose to add method SetDistinct() to SqlArray.
It can be easily implemented.
private:
bool distinct;
public:
SqlArray& SetDistinct(bool flag = true) { distinct = flag; return *this; }
Fixes for SqlArray::AppendQuery().
SqlSet select_cols;
select_cols = (distinct ? Distinct(cols) : cols);
if(IsNull(count))
sql * ::Select(select_cols).From(table).Where(wh).OrderBy(orderby) ;
else
sql * ::Select(select_cols).From(table).Where(wh).OrderBy(orderby) .Limit(count).Offset(offset);
Actually, it is a little bit inconvenient to have an SQL statement incorporated into SqlArray. It limits you by letting to use only one table and forces to reimplement all SQL-building API.
I hope I'm not very boring.
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Wed May 15 23:46:04 CEST 2024
Total time taken to generate the page: 0.02313 seconds
|