سؤال

I know that I can use something like

select distinct left(table.column, 1) as firstChar
from table

In MySQL to return just the first character of a field.
The problem is I'm working with SQL Derby :( and it does not like this syntax.

Is there a way to perform this query using derby?

هل كانت مفيدة؟

المحلول

select substr(table.column,1,1) 
from table
order by table.column
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top