Hello Gertrud,
Thank you for your reply.
I think I did not explain my problem correctly. I want to retrieve values from the columns ACK_FINDING, ACK_VALUE or ACK_NOTES by applying conditions on the columns ACK_DESC and/or OBJ_DESC.
For instance, I would like to retrieve:
ACK_VALUE where ACK_DESC='conductivity data record' , ACK_FINDING where ACK_DESC='check safety valve' and OBJ_DESC='Biocide dosing pump' , etc ... while using FROM only once (I also use a query to create my table and I do not want to call the table each time I pick up a value since I need to retrieve a lot of data).
Best regards.
------------------------------
Antoine André
------------------------------
Original Message:
Sent: Mon April 19, 2021 04:02 AM
From: Gertrud Lohwasser
Subject: Multiple SELECT with conditions on one FROM
Hello Antoine,
to rephrase your needs: You are looking for
- a SELECT * FROM mytable WHERE val1= cond1 and val2=cond2 and ....,
- or SELECT cal1, val2, val3 .... FROM mytable WHERE val1= cond1 and val2=cond2 and ....
So if I understand this right, then just pick the items from your table and define the conditions as filters.
Regards
------------------------------
Gertrud Lohwasser
Original Message:
Sent: Fri April 16, 2021 02:42 AM
From: Antoine André
Subject: Multiple SELECT with conditions on one FROM
Hello everyone,
I am trying to SELECT multiple data from a table (see below). Each SELECT would have its own condition (WHERE, IF, whatever ...). Each SELECT retreives a data either from ACK_FINDING, ACK_VALUE or ACK_NOTES
Instead of calling the table via FROM for each SELECT in this way: SELECT val1 FROM mytable WHERE cond1 SELECT val2 FROM mytable WHERE cond2 ....
To make an efficient code, I would like to write something like: SELECT val1 with cond1 val2 with cond2 FROM mytable
Could you please help me to solve my problem?
If any information is missing, please let me know!
Thank you!
------------------------------
Antoine André
------------------------------
#CognosAnalyticswithWatson