Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to show alerts in table

 
Geeta Ravikanti
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my table

Sno Close1 avg

1 150 110
2 210 175
3 110 150

its my table structure
i am comparing the close1 values with avg values
that is if close1>avg i want to display the message like "Good"
if close1<avg i want diplay the the message like"bad"

my final structure is

Sno Close1 avg result

1 150 110 bad
2 210 175 bad
3 110 150 good


how to write the qery for above table

if any body have idea please tell how to diplay the messages in table
 
Prem Shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Geetha,
try using case statements in your updates
Example:
UPDATE <tablename>
SET result = CASE
WHEN close1>avg THEN 'good'
ELSE 'bad'
END;
 
Geeta Ravikanti
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tahnQ for the reply
your logic is working
thanQQQQQQQQQQQQQQQq
 
Geeta Ravikanti
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another problem regaridnt the query
I dont know how to write the triggers
my problem is sending the message ti any eamilid when the trigger is fired
how to write the trigger for this
i searchd from the google
but i am uable to get the things properly

can help me in this
plzzzzzzz
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic