Created
July 6, 2012 13:18
-
-
Save dileeph/3060105 to your computer and use it in GitHub Desktop.
JooQ - groupBy with function issue - ORA000979
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Field<String> toChar(Field<Timestamp> timestampField, | |
String format) { | |
return Factory.function("to_char", String.class, timestampField, | |
Factory.val(format)); | |
} | |
@Test | |
public void testToChar() { | |
Field<String> tochar = toChar(MZ_LOGIN_STATISTICS.TIME_IN, "MON"); | |
factory.select(Factory.count(), tochar).from(MZ_LOGIN_STATISTICS) | |
.join(MZ_USER_DETAILS) | |
.on(MZ_LOGIN_STATISTICS.USER_ID.equal(MZ_USER_DETAILS.USER_ID)) | |
.groupBy(tochar).fetch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment