[sqlite] help with query

2015-01-12 Thread Hajo Locke
Hello list, i have a problem finding right query, hope you can help me. I have a sample table like this: http://pastebin.com/8qyBzdhH I want to select all lines where at least 3 lines in column data1 have same value. My expected result-set ist this: http://pastebin.com/UcaXLVx9 How can this

Re: [sqlite] Error in amalgamated file

2015-01-12 Thread Richard Hipp
On 1/12/15, Dan Ackroyd wrote: > Hi, > > It looks like there is an error in the amalgamated file on line 139834: > > "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?" > "ORDER BY level DESC, idx ASC", > > There is no space between the question mark on the

[sqlite] Error in amalgamated file

2015-01-12 Thread Dan Ackroyd
Hi, It looks like there is an error in the amalgamated file on line 139834: "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?" "ORDER BY level DESC, idx ASC", There is no space between the question mark on the first line, and the 'ORDER' on the second line - which should generate

Re: [sqlite] Win 64 SQLLite 90 - badimageformatexception

2015-01-12 Thread Taylor, Jill (RBI-US)
This did not solve the problem? The machine compile and running the process and dll is the same. It is a Windows 7 64 bit machine The target is x64. The process and dll both have enable native code debugging turned on under the projects properties debug tab. The Dll is referencing the 90

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Clemens Ladisch
Dominique Devienne wrote: > On Mon, Jan 12, 2015 at 4:13 PM, Igor Tandetnik wrote: >> On 1/12/2015 9:53 AM, Dominique Devienne wrote: >>> My little brain has no idea how the "a;b:c/c,d" came about from the input >>> rows, so I don't find it logical at all myself... >> >>

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Igor Tandetnik
On 1/12/2015 10:37 AM, Dominique Devienne wrote: OK, lets follow that logic: 1) a-comma yield just a (first row special case) 2) b-semi-colon yields semi-colon b 3) c-slash (both of them, collapsed by DISTINCT) yields slash c 4) c-colon yields colon c 5) d comma yields comma d so that's

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Dominique Devienne
On Mon, Jan 12, 2015 at 4:13 PM, Igor Tandetnik wrote: > On 1/12/2015 9:53 AM, Dominique Devienne wrote: > >> My little brain has no idea how the "a;b:c/c,d" came about from the input >> rows, so I don't find it logical at all myself... >> > > Simple, really. For each ('x',

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Igor Tandetnik
On 1/12/2015 9:53 AM, Dominique Devienne wrote: My little brain has no idea how the "a;b:c/c,d" came about from the input rows, so I don't find it logical at all myself... Simple, really. For each ('x', '@') row, string_agg adds '@x' to the resulting string (except the separator is omitted

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Dominique Devienne
On Mon, Jan 12, 2015 at 2:30 PM, Richard Hipp wrote: > Certainly the group_concat() case you cite, with a constant second > term makes sense. But any code I write needs to work *in general*, > and not for just that one special case. > Is it not possible to detect the

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Dominique Devienne
On Mon, Jan 12, 2015 at 3:36 PM, Staffan Tylen wrote: > On Mon, Jan 12, 2015 at 3:25 PM, Clemens Ladisch > wrote: > > > Testing shows that the DISTINCT > > applies to the function, not to individual parameters,

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Staffan Tylen
On Mon, Jan 12, 2015 at 3:25 PM, Clemens Ladisch wrote: > Testing shows that the DISTINCT > applies to the function, not to individual parameters, and that indeed > the set of all parameters is checked: > > This is to me the most

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Dominique Devienne
On Mon, Jan 12, 2015 at 2:30 PM, Richard Hipp wrote: > Are there any other SQL database engines that allow multi-argument > aggregate functions? What do those systems do? The "that take a single argument" fragment seems to imply DISTINCT is not allowed my multi-args aggregate

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Clemens Ladisch
Richard Hipp wrote: > So if you say "group_concat(DISTINCT x,y)" does that mean that the > combination of x and y must be distinct or that only x is distinct? > Are we allowed to say "group_concat(x, DISTINCT y)" or > "group_concat(DISTINCT x, DISTINCT y)". And what does the latter > mean,

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Richard Hipp
On 1/12/15, Staffan Tylen wrote: > Thanks Clemens. I notice however that nobody has attempted to respond to my > original questions. I'm mostly interested in why the documentation states > that DISTINCT can only be used with aggregate functions taking a single > argument,

Re: [sqlite] aggregate functions with DISTINCT

2015-01-12 Thread Staffan Tylen
Thanks Clemens. I notice however that nobody has attempted to respond to my original questions. I'm mostly interested in why the documentation states that DISTINCT can only be used with aggregate functions taking a single argument, which in fact is only one, namely GROUP_CONCAT. For a person like