• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how to show alerts in table

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic