SQL - need some help, tnx
Hi,
Short question : how do I replace a value (that is the ID of a message) in an SQL? More info, tables involved: Quote:
Quote:
If, in tblGauge, the condition is - say - 5, the 5 should be replaced with the fifth message (ie tblConditions.ID = 5) in tblConditions. I _could_ run the SQL and then replace de integer value with a message for each line individually and then put the whole in the DefaultTableModel, but that is ... silly. Can SQL do that for me? Yes! How? I dont know. And direction is appreciated... Tnx in advance! Thor |
Phrasing it as "replace a value" was confusing; at first I thought you were asking about the UPDATE statement.
If I understand correctly, you want: Code:
SELECT tblGauge.ID, tblConditions.description, tblGauge.level |
Hey!
That could be it! Joins (as in left join, inner and the like) always escaped me... The result could then me something like: 1 severe 15 2 mild 5 where the tblConditions.ID as 15 would have "severe" as description and the one with 5 "mild" Big-big tnx! You've saved my Sunday here! Thor! |
I tested this and it works like a charm!
Thanks!! Thor |
All times are GMT -5. The time now is 04:46 PM. |