You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am struggeling to compose a query with subselects.
Given two tables
CREATE TABLE event
(
id serial,
name varchar NOT NULL,
description varchar,
track_id integer NOT NULL,
);
CREATE TABLE track
(
id serial,
name varchar NOT NULL,
);
What I try to accomplish is to select all events where a searchArg is contained in event.name, event.description or trach.name
The SQL would look like this
select id from event
WHERE name ilike $1
OR description ilike $1
OR track_id in (select id from track where name ilike $1)
with $1 beeing the searchArg
I used the code generation and this works fine.
The first two parts could be handled like this
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am struggeling to compose a query with subselects.
Given two tables
What I try to accomplish is to select all events where a searchArg is contained in event.name, event.description or trach.name
The SQL would look like this
with $1 beeing the searchArg
I used the code generation and this works fine.
The first two parts could be handled like this
So far so good. A sub select could be this one
My problem is to combine this with the above query. Can someone give me a hint?
Beta Was this translation helpful? Give feedback.
All reactions