Forum: Ruby Couting coumn and get a specifiq record?

7a00759a160167e20768ac7997b05314?d=identicon&s=25 Robert Mike (robert09)
on 2014-03-26 17:52
Hi
suppose i have a table like this

Name math English Science
Jim  90     33      33
Mike 77     40      40
Mike 80     50      90

how will i count :-

1) how many column this table has ?
2)  what the score for Mark in English ?




  any sample code or web link related to this would be greatfull.
249c7fd851c5c5ac5a1abdb756472ae1?d=identicon&s=25 Arup Rakshit (my-ruby)
on 2014-03-27 16:53
Robert Mike wrote in post #1141101:

>
> how will i count :-
>
> 1) how many column this table has ?
> 2)  what the score for Mark in English ?
>

Do you have it in CSV format ?
7a00759a160167e20768ac7997b05314?d=identicon&s=25 Robert Mike (robert09)
on 2014-03-28 22:33
Hi
no, its coming from sql query .

but i cant do column count from sql query.
i need to do this from  my ruby script

please advise.
249c7fd851c5c5ac5a1abdb756472ae1?d=identicon&s=25 Arup Rakshit (my-ruby)
on 2014-03-29 07:17
Robert Mike wrote in post #1141377:
> Hi
> no, its coming from sql query .
>
> but i cant do column count from sql query.
> i need to do this from  my ruby script
>
> please advise.

I understand. Do you saving the result of the sql query in any place ?
May be show us how are you fetching the result.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.