次の図に示すように、ネイティブSQLクエリを使用して結果を取得しようとしましたが、SQLのみを使用してこの結果を得る方法がないかどうかは現在わかりません。特定の結果のSQL使用数または合計
私はこのクエリの周りだったが、現在はさらにないアイデア:
CREATE TABLE receipts
(
receipt_id int primary key,
client_code varchar not null,
create_date date not null
);
insert into receipts (receipt_id, client_code, create_date) values (1, 'fx90', to_date('2016/01/11', 'yyyy/MM/dd'));
insert into receipts (receipt_id, client_code, create_date) values (2, 'fx90', to_date('2016/02/12', 'yyyy/MM/dd'));
insert into receipts (receipt_id, client_code, create_date) values (3, 'fx90', to_date('2016/02/20', 'yyyy/MM/dd'));
insert into receipts (receipt_id, client_code, create_date) values (4, 'fx90', to_date('2016/03/11', 'yyyy/MM/dd'));
insert into receipts (receipt_id, client_code, create_date) values (5, 'fx90', to_date('2016/03/12', 'yyyy/MM/dd'));
insert into receipts (receipt_id, client_code, create_date) values (6, 'fx90', to_date('2016/03/19', 'yyyy/MM/dd'));
例
が見えます。 'DATE_TRUNC'は有効なMySQL関数ではないので、なぜこの質問にmysqlが付いているのかは不明です。 – spencer7593
true - mysqlタグが削除されました – PDS