Re: sql query problem

Поиск
Список
Период
Сортировка
Искать

Re: sql query problem

От:
Misa Simic <misa.simic@gmail.com>
Дата:
It seems question is not clear...

I could not determine what should be in column Attended, and based on
what should define passed/failed

But quick tip would be

SELECT name, CASE status WHEN 1 THEN 'Passed' ELSE 'Failed' END FROM
UserTable INNER JOIN result ON UserTable.id = result.user_id

Sent from my Windows Phone
From: Alok Thakur
Sent: 15/01/2012 22:08
To: pgsql-sql@postgresql.org
Subject: [SQL] sql query problem
Dear All,

I have two tables one contains details of user and other contains
result. The details are:
1. UserTable - id, name, phone
2. result - id, question_id, user_id, status (0 or 1)

I want the list like this:
User Id   Name   Attended   Failed   Passed

but i could not find the way to do this.

Please help

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: sql query problem

От:
Misa Simic <misa.simic@gmail.com>
Дата:

Re: sql query problem

От:
Andreas Kretschmer <akretschmer@spamfence.net>
Дата:

sql query problem

От:
Alok Thakur <alokthakur1987@gmail.com>
Дата:

Re: sql query problem

От:
Alok Thakur <alokthakur1987@gmail.com>
Дата:

Re: sql query problem

От:
Oliveiros <oliveiros.cristina@gmail.com>
Дата:
What does a 0 state mean? Failed? And a 1 state? Passed?

Best,
Oliveiros

2012/1/14 Alok Thakur <alokthakur1987@gmail.com>
Dear All,

I have two tables one contains details of user and other contains
result. The details are:
1. UserTable - id, name, phone
2. result - id, question_id, user_id, status (0 or 1)

I want the list like this:
User Id   Name   Attended   Failed   Passed

but i could not find the way to do this.

Please help

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: sql query problem

От:
David Johnston <polobo@yahoo.com>
Дата:
FAQ