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 » OrderBy Descending missing
OrderBy Descending missing [message #21048] Tue, 28 April 2009 19:25 Go to previous message
phirox is currently offline  phirox
Messages: 49
Registered: December 2007
Member
I found this previous topic about the same thing. But it says there is a descending() function, I could find no such thing. So I just added the suggested OrderByDesc() function.

In Sqlexp.h:
SqlSelect& OrderByDesc(const SqlSet& columnset);
SqlSelect& OrderByDesc(SqlVal a)                      { return OrderByDesc(SqlSet(a)); }
SqlSelect& OrderByDesc(SqlVal a, SqlVal b)            { return OrderByDesc(SqlSet(a, b)); }
SqlSelect& OrderByDesc(SqlVal a, SqlVal b, SqlVal c)  { return OrderByDesc(SqlSet(a, b, c)); }


And in SqlStatement.cpp
SqlSelect& SqlSelect::OrderByDesc(const SqlSet& set) {
	if(!set.IsEmpty())
		text << " order by " << ~set << " desc";
	return *this;
}

[Updated on: Wed, 29 April 2009 10:04]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: sql example with 2 table needed
Next Topic: sqlite3 get number of occurrences
Goto Forum:
  


Current Time: Sat Apr 27 20:04:02 CEST 2024

Total time taken to generate the page: 0.04663 seconds