Jan 24, 2014 17:30
THEN 1 means true ?
Jan 24, 2014 17:28
ok
Jan 24, 2014 17:27
1 means true like in programming ?
Jan 24, 2014 17:18
makes me confused between them
Jan 24, 2014 17:18
count and sum looks too similar
Jan 24, 2014 17:16
OK
Jan 24, 2014 17:14
in case of using count , it ignores null values , and sum does not ignore null values ?

IF i used sum , i will set ELSE 0 so when it found a null value it would set it as 0 , right ?
Jan 24, 2014 17:09
ELSE NULL will but 0 if no result there ?
Jan 24, 2014 17:05
thanks for helping me :)
Jan 24, 2014 17:05
ok
Jan 24, 2014 17:04
so books is better in your opinion, right ?
Jan 24, 2014 17:02
okay thanks :D , i will take a look about this book
Jan 24, 2014 16:59
any recommendation for a video tutorial ?
Jan 24, 2014 16:54
okay , but i don't want to miss some expressions behind , i saw the content of this informit.com/store/… but i don't know will say talk about case when for example or no :(
Jan 24, 2014 16:50
but i don't mind to have a refresh about the basics one more time , then learning about the advanced
Jan 24, 2014 16:49
no i wrote it
Jan 24, 2014 16:49
i studied the basics previous year in my collage
Jan 24, 2014 16:46
after i have seen you answer i decided to look for a video tutorial to learn about the advanced query , but does this course include the function you have used in the answer (case when) ?
Jan 24, 2014 16:45
where i can learn this advanced querying ? is this can help me ? pluralsight.com/training/Courses/TableOfContents/…
Jan 24, 2014 16:43
my question is about the answer you typed at first which using case when
Jan 24, 2014 16:40
Thanks , i didn't alter order by now its working , i have another question hope you can help be , but its not an error , although its related to sql too
Jan 24, 2014 16:30
SELECT em_id , em_type, advisor_name, MAX(t.opened_complaints) AS opened_complaints, MAX(t.in_progress_complaints) AS in_progress_complaints, MAX(t.pending_complaints) AS pending_complaints, MAX(t.closed_complaints) AS closed_complaints, MAX(t.solved_complaints) AS solved_complaints
FROM
((SELECT DISTINCT ON (advisor_id) advisor_id as em_id, employees.type as em_type ,employees.full_name as advisor_name, COUNT(ticket_statuses.status_id) AS opened_complaints, 0 AS in_progress_complaints, 0 AS pending_complaints, 0 AS closed_complaints, 0 AS solved_complaints
Jan 24, 2014 15:56
hey