I want to write an SQL query to find records which contain a particular column and from that subset want to find records which doesn’t contain a some other value. How do you write a query for that? …
Adding distinct data to jComboBox from database
I have a jComboBox which i want to fill up with the departments of the students in a database. Now the same department occurs many times in the table so i want each department name to go only once to …
Adding quotes into a sql query with Vba code
I can recover data from my database using vba, but I have to add quotes on the result of column (“value1”, “Value2”, “Value3” etc) But I do not know how to add quotes inside the SQL query, when using “…
select rows with events related with another events in the same query column
I need to select rows with EventTypeID = 19 which does not have related EventtypeID = 21 LoggedOn exactly 4 minutes earlier for the same EmployeeID. Here’s the query bellow and some raw output: …
How do I keep my “validity” row always updated in relation to my “expiration date” row?
This is my database’s survey table: I learned to use CURDATE() and DATEADD(), so the table can now automatically calculate the survey_date and its expiration_date. But I’d also like to add a value …
Converting NVARCHAR to INT after SUBSTRING using CHARINDEX and LEN
I am trying to join two tables using UI’s but the UI in one of the tables has ‘CLIENT_’ before it. When trying to remove the ‘CLIENT_’ from the string and then compare the UI’s I am getting the …
Laravel 5.8 / Mysql: Cannot delete or update a parent row a foreign key constraint fails
I am trying to setup my tables in my MySQL database and and I am currently creating migration files using Laravel 5.8. When I run a fresh migration with php artisan migrate all the migrations run …
What is more efficient, few small related tables or one big?
I have information about a Shop. It belongs, to a City. City belongs to the Country. And Country belongs to a Continent. Should I make one big table that contains 4 columns with information about …
Escape single quotes from comma separated string in Oracle
I am trying to escape single quotes from the comma separated string in Oracle SQL Developer, below is my Select query: SELECT (CASE WHEN PS.SUPPLIER_NO IS NULL THEN ‘FALSE’ ELSE ‘TRUE’ END) AS “Check”…
Group by a table then add another tables count into the first table grouped count
I want to group by the First table then add the result of the second and third table with the grouped count… But with a dummy servicecode select servicecode, Count(*) as count from servicerequest …