Skip to content

Tag: sql

SQL ManyToOne condition

But if I add one more for my query (that not related to this), for example: I should get nothing (but it needs to be workable :D) Answer You can do a GROUP BY, and use HAVING to make sure all desired tag_id’s are there:

SQL query with meta_key,meta_value and have 2 conditions

I am trying to do an SQL query to find a form id of the Registration form of the user on a wordpress site, because this form doesn’t have the id of the user yet, I have to find the user email which is unique and check if the gdprchekbox-1 is true because it is only used for the registering

How to fetch single records using case statements

I want to fetch single record from the table test_table if any one of the value is null in the column e_value then it should print No else Yes My Attempt: Current Output: Expected Output: Answer you can use GROUP BY and COUNT: The count will return number of non-null values db<>fiddle here

SQL ‘insert into select’ into existing table

I wrote a simple insert into statement: I got this error: Cannot insert the value NULL into column ‘Worker_ID’, table ‘Worker’; column does not allow nulls. INSERT fails (By the way Worker.WorkingPlace is a nullable column) I’m very confused, because I’m just inserting data…

Merge/looping through an sql query with another query?

I don’t think my post title is correct/the best but I don’t really know how to concisely explain it. I have one SQL query This returns 600+ results I then need to run against every ID returned from the first query. Is it possible to merge these two queries together to return one table that looks l…

Informix doubly nested MULTISET remains empty

Given this schema: I tried running a query like this: But the output suggests that the inner most nested MULTISET query doesn’t work. The output is: Is this a known limitation or a bug? How can I work around this limitation? I’m using IBM Informix Dynamic Server Version 14.10.FC5DE Answer Just lik…

How to nest MULTISET in unnamed ROW in Informix?

Given this schema: The following query looks correct to me: But it produces some unspecified internal error: SQL Error [IX000]: User Defined Routine (collectionsend) execution failed. Is this a documented limitation? How can I work around this problem? I’m using IBM Informix Dynamic Server Version 14.10…