Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SqlArray::SetDistinct()
SqlArray::SetDistinct() [message #7410] Wed, 27 December 2006 23:45 Go to previous message
Novo is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: SqlArray::Join when a foreign key has more than one field
Next Topic: SqlArray Limit and Offset
Goto Forum:
  


Current Time: Wed May 15 23:46:04 CEST 2024

Total time taken to generate the page: 0.02313 seconds