Member since
07-11-2022
3
Posts
0
Kudos Received
0
Solutions
07-11-2022
01:21 PM
DROP TABLE IF EXISTS...
... View more
07-11-2022
09:18 AM
Hi Steven9, is posible if you use as follow: /* DROP, CREATE AND INSERT */ DROP IF EXIST YOUR_LIBRARY.YOUR_TABLE; CREATE TABLE IF NOT EXISTS YOUR_LIBRARY.YOUR_TABLE(Ciudad VARCHAR(50), Valor BIGINT); INSERT INTO TABLE YOUR_LIBRARY.YOUR_TABLE VALUES (CAST("BOGOTA" AS VARCHAR(50)), 1000), (CAST("CARTAGENA" AS VARCHAR(50)), 500), (CAST("MEDELLIN" AS VARCHAR(50)), 50), (CAST("PURIFICACION" AS VARCHAR(50)), 600), (CAST("DOLORES" AS VARCHAR(50)), 250) (CAST("CALI" AS VARCHAR(50)), 450), ; /* VARIABLES */ ${TRX=500}; ${CITY="MEDELLIN"}; /* USING VARIABLES TO EXTRACT FROM TABLE */ SELECT * FROM YOUR_LIBRARY.YOUR_TABLE WHERE VALOR >= ${TRX}; SELECT * FROM YOUR_LIBRARY.YOUR_TABLE WHERE CIUDAD <> ${CITY};
... View more
07-11-2022
09:17 AM
Hi Sai, is possible if you use as follow /* DROP, CREATE AND INSERT */ DROP IF EXIST YOUR_LIBRARY.YOUR_TABLE; CREATE TABLE IF NOT EXISTS YOUR_LIBRARY.YOUR_TABLE(Ciudad VARCHAR(50), Valor BIGINT); INSERT INTO TABLE YOUR_LIBRARY.YOUR_TABLE VALUES (CAST("BOGOTA" AS VARCHAR(50)), 1000), (CAST("CARTAGENA" AS VARCHAR(50)), 500), (CAST("MEDELLIN" AS VARCHAR(50)), 50), (CAST("PURIFICACION" AS VARCHAR(50)), 600), (CAST("DOLORES" AS VARCHAR(50)), 250) (CAST("CALI" AS VARCHAR(50)), 450), ; /* VARIABLES */ ${TRX=500}; ${CITY="MEDELLIN"}; /* USING VARIABLES TO EXTRACT FROM TABLE */ SELECT * FROM YOUR_LIBRARY.YOUR_TABLE WHERE VALOR >= ${TRX}; SELECT * FROM YOUR_LIBRARY.YOUR_TABLE WHERE CIUDAD <> ${CITY};
... View more