On Thursday, July 03, 2014 11:49:04 AM John R Pierce wrote:
> On 7/3/2014 8:24 AM, Arup Rakshit wrote:
> >> OT, but it boggles my mind that anyone thinks thats 'better' than the
> >>
> >> >straight SQL
> >
> > I would like to see your idea. Could you please ? My thick brain not able
> > to produc
On 7/3/2014 8:24 AM, Arup Rakshit wrote:
OT, but it boggles my mind that anyone thinks thats 'better' than the
>straight SQL
I would like to see your idea. Could you please ? My thick brain not able to
produce any straight forward one. Not so good in sql recently..
I was referring to the ORM s
On Thursday, July 03, 2014 09:04:36 AM John R Pierce wrote:
> On 7/3/2014 4:01 AM, Arup Rakshit wrote:
> > Exactly.. I am done. Here is the ORM query :-
>
> OT, but it boggles my mind that anyone thinks thats 'better' than the
> straight SQL
I would like to see your idea. Could you please ? My t
Are you sure this is what you want?
Since there are two columns you will have to either use a CASE or a
sub-select to facilitate calculating the values for each of the columns.
SELECT gender, answer1_avg, answer2_avg
FROM (SELECT DISTINCT gender FROM ...) gn
LEFT JOIN (SELECT gender, answer1
On Thursday, July 03, 2014 09:04:36 AM John R Pierce wrote:
> On 7/3/2014 4:01 AM, Arup Rakshit wrote:
> > Exactly.. I am done. Here is the ORM query :-
>
> OT, but it boggles my mind that anyone thinks thats 'better' than the
> straight SQL
I would like to see your idea. Could you please ? My t
On 7/3/2014 4:01 AM, Arup Rakshit wrote:
Exactly.. I am done. Here is the ORM query :-
def self.employee_learning_by_gender(question_id)
cpd_id = Measure.find_by(option: 'CPD').id
other_id = Measure.find_by(option: 'Others').id
User.select("view.gender, sum(view.participant) as par
Hi,
I am working on web development project. There I am using this awesome DB. Let
me tell you first the schema that I am having associated the problem.
I am having a table *users* - which has many fields. Out of them, the one I
need here is *gender*. This column can have value "f"/"m"/"n".
I
Without commenting on the rest of it...to combine what you show here just
GROUP BY gender and SUM() everything else (i.e., turn the above into a
subquery and then do this)
David J.
Exactly.. I am done. Here is the ORM query :-
def self.employee_learning_by_gender(question_id)
cpd_id =
unsubscribe pgsql-general@postgresql.org
Arup Rakshit wrote
> SELECT users.gender,count(*) as participant,
> case when daily_action_answers.measure_id = 1 then
> avg(daily_action_answers.value) end as cpd,
> case when daily_action_answers.measure_id = 2 then
> avg(daily_action_answers.value) end as other
> FROM users INNER JOIN daily_act
Are you sure this is what you want?
Since there are two columns you will have to either use a CASE or a
to facilitate calculating the values for each of the columns.
SELECT gender, answer1_avg, answer2_avg
FROM (SELECT DISTINCT gender FROM ...) gn
LEFT JOIN (SELECT gender, answer1_avg FROM
On 02 Jul 2014, at 18:55, Arup Rakshit wrote:
> Hi,
>
> I am working on web development project. There I am using this awesome DB.
> Let
> me tell you first the schema that I am having associated the problem.
>
> I am having a table *users* - which has many fields. Out of them, the one I
> n
afonit wrote
>> genderparticipants answer1_avg answer2_avg
>> n 3 12 3
>> m 5 4 12
>> f 71523
Are you sure t
On Wednesday, July 02, 2014 12:28:04 PM David G Johnston wrote:
> Steve Crawford wrote
>
>
> Are you sure this is what you want?
>
> Since there are two columns you will have to either use a CASE or a select
> to facilitate calculating the values for each of the columns.
>
> SELECT gender, ans
On Wednesday, July 02, 2014 12:28:04 PM David G Johnston wrote:
> Steve Crawford wrote
>
>
> Are you sure this is what you want?
>
> Since there are two columns you will have to either use a CASE or a select
> to facilitate calculating the values for each of the columns.
>
> SELECT gender, ans
Steve Crawford wrote
> On 07/02/2014 09:55 AM, Arup Rakshit wrote:
>> SELECT users.gender,count(*) as
>> participant,avg(daily_action_answers.value) as
>> value
>> FROM "users" INNER JOIN "daily_action_answers" ON
>> "daily_action_answers"."user_id" = "users"."id"
>> INNER JOIN "measures" ON "measu
On 07/02/2014 09:55 AM, Arup Rakshit wrote:
SELECT users.gender,count(*) as participant,avg(daily_action_answers.value) as
value
FROM "users" INNER JOIN "daily_action_answers" ON
"daily_action_answers"."user_id" = "users"."id"
INNER JOIN "measures" ON "measures"."id" = "daily_action_answers"."mea
On Wednesday, July 02, 2014 02:49:54 PM you wrote:
> On Wed, Jul 2, 2014 at 1:44 PM, Arup Rakshit
>
> wrote:
> > *group by* on full table(*users*). I am away from our production DB. Could
> > you
> > tell me how this little change will solve the whole problem and help me to
> > get
> > the data a
On 7/2/2014 10:44 AM, Arup Rakshit wrote:
*group by* on full table(*users*). I am away from our production DB. Could you
tell me how this little change will solve the whole problem and help me to get
the data as per the format I am looking for.
I believe he meant
group by users.gender
On Wed, Jul 2, 2014 at 1:44 PM, Arup Rakshit
wrote:
>
> *group by* on full table(*users*). I am away from our production DB. Could
> you
> tell me how this little change will solve the whole problem and help me to
> get
> the data as per the format I am looking for.
>
Arup,
I meant:
GROUP BY use
On Wednesday, July 02, 2014 02:38:36 PM jared wrote:
> you have:
> GROUP BY users.gender, measures.option
>
> instead try:
> GROUP BY users
>
>
*group by* on full table(*users*). I am away from our production DB. Could you
tell me how this little change will solve the whole problem and help me
you have:
GROUP BY users.gender, measures.option
instead try:
GROUP BY users
On Wed, Jul 2, 2014 at 12:55 PM, Arup Rakshit
wrote:
> Hi,
>
> I am working on web development project. There I am using this awesome DB.
> Let
> me tell you first the schema that I am having associated the problem.
>
Hi,
I am working on web development project. There I am using this awesome DB. Let
me tell you first the schema that I am having associated the problem.
I am having a table *users* - which has many fields. Out of them, the one I
need here is *gender*. This column can have value "f"/"m"/"n".
I
23 matches
Mail list logo