Query all records, where foreign reference does NOT exist
Hi,
I'm trying to do a query in table A, where table B does not have a record with a column pointing to table A. I'm looking around the inner join queries but don't see an obvious way to do it. Ideas?
Best Answer
-
As often happens, I found the solution before waiting for an answer.
I used a combination of inner join and the custom query. For some reason I thought I couldn't use custom query on tables that were joined, but you can. So I did a "left" join, enabled the option to "IGNORE EMTPY VALUES", then in custom query I did a queried where A.id == null (or, in my case, I did have an exception where if row A existed it could be included in the results if A.foo == "specific_value").
Answers
-
Glad you solved it 😊 and thank you for sharing the answer! Always super helpful when other people are looking to solve for the same question!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback