Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 710

QOQ distinct with Datetime column

$
0
0

After an upgrade to Lucee 6, we get a strange result if we are using a QOQ with a distinct to a datetime field.

I been able to reproduce it with that code

var rsData = queryNew( "scheduleLabel,scheduleTime", "varchar,datetime");
for(var i=1; i<= 50; i++) {
	var scheduleTime  = createDateTime(2024, 12, 12, i mod 12, 0, 0,0)
	rsData.addRow({scheduleLabel: "Event : #i mod 12#", scheduleTime: scheduleTime});
}

var rsUniqueDataTime = queryExecute(
    sql = "SELECT DISTINCT scheduleTime FROM rsData ORDER BY scheduleTime",
    options = {
        dbtype = 'query'
    }
);
 
writeDump(var=rsData, label="rsData");
writeDump(var=rsUniqueDataTime, label="rsUniqueDataTime");

As you can see, the distinct don’t return the result expected
image

OS: Windows 10 (10.0) 64bit
Servlet Container WildFly / Undertow - 2.2.24.Final
Java Version: 11.0.19 (Eclipse Adoptium) 64bit
Lucee Version: 6.0.3.1

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 710

Trending Articles