c# - Formatting headers for SQL statements -


i have table of baseball stats in csv file query as,

select      birthstate, count(playerid)       [master.csv]  group      birthstate  order      count(birthstate) desc 

the result displayed as,

birthstate  expr1001 --------------------    ca       2160    pa       1417    ny       1207    il       1054 

i have (imperfect) logic iterate on column names in resulting datatable (i'm using c#) fill in headers above.

is there way represent header of second column count(playerid) instead of expr1001?

thanks.

if use "as" (or alias) command return computed column specified header:

select birthstate, count(playerid) numberofplayers [master.csv] group birthstate order count(birthstate) desc 

i'm not sure if can label header "count(playerid)" way, using square brackets around name:

select birthstate, count(playerid) [count(playerid)] [master.csv] group birthstate order count(birthstate) desc 

should treat text text rather command.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -