Can you add an arbitrary row when using an SQL Query?

Hey guys! I'm currently fetching a list of users assigned to a ticket to use in a filter. And I want an option for no assigned user as well. Due to the constraints of Retool, which I'm working in, I don't have a ton of control over the dropdown input to be able to put in a select for a "no value", but I need it in order to be able to filter out for tickets that don't currently an assingnee. Right now my query looks something like this:
select id, email, first_name, last_name
from users
where true
and not users.is_deleted
and users.admin_roles @> '{"removedforsecurity)": {}}'::jsonb
order by is_deleted desc, email
select id, email, first_name, last_name
from users
where true
and not users.is_deleted
and users.admin_roles @> '{"removedforsecurity)": {}}'::jsonb
order by is_deleted desc, email
I was wondering if there was a way to get a row that doesn't actually exist and put in arbitrary data to it. In other words, select an id of null, with an email of null, and first and last name of null. That doesn't exist in the database currently, and I don't believe they want to add one (logically so), so I was wondering if there was a way to do this.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server