I have very large table around 15 GB.

schema is create table cash_order(Record_Indicator char(2) not null, Segment char(4) not null,Order_number bigint unsigned not null, Transaction_Times bigint not null, Buy_Sell_Indicator char(1) not null, Activity_Type Int(1) not null,Symbol varchar(10) not null, Series char(2) not null, Volume_Disclosed int unsigned not null,Volume_Original int unsigned, Limit_Price int unsigned, Trigger_Price int unsigned, Market_Order_Flag char(1) not null,Stop_Loss_Flag char(1) not null, IO_Flag char(1), Algo_Indicator int(1), primary key(Order_number,Buy_Sell_Indicator,Symbol,Transaction_Times))max_rows=5000000000;

from that table I have to show the like

first column (distinct Symbol), second column (Number of orders which belong to Symbol), third column( number of orders which belong to Symbol and also Algo_Indicator=0), fourth column(number order which belong to Symbol and also Algo_Indicator=0, Market_Order_Flag='Y') like wise it goes on.

for example it should look like this

bharthi,1020,890,400,......

bharathi is symbol name, bharathi has 1020 number of orders. out of 1020 orders the 890 orders are algo_indicator=0, and out of 890 orders the 400 orders are market_order_flag='y'.

select Symbol,count(Order_number)from cash_order01 where Algo_Indicator=0 group by Symbol order by count(Order_number) desc into outfile '/tmp/exe4.csv';

I have used this command but i generated the number of order_number which satisfy the condition that Algo_Indicator=0 not the total order number;

Can any one help me.

More Bharathi Raja A's questions See All
Similar questions and discussions