Table 1: employee_detail: id name 1 ABC 2 CCC 3 FFF 4 ggg 5 jjj Table 2: performance_appraisal id …
Tag: sql
Error 424 object required after NULL SQL query
I am running some EXCEL VBA code to update the contents of an ACCESS database table along the lines suggested here: IF @@Rowcount = 0 — SQL Syntax Error in Access . When I execute the SELECT query, …
The reference constraint is being triggered but unable to select rows from the table that would trigger it
I am attempting to update a bunch of different tables in my database. However, when the update is completed, I am unable to delete a record from another table due to a foreign key constraint. However, …
How do I compare two SQL queries to run on Postgres
I need to compare two queries that will run in my Postgres database. How do I know the execution time and any other statistics of them so I can produce a reliable benchmark between them? Answer I can think of two interesting data points to collect and compare: The execution time. For that, simply execute the …
How to order a recordest returned from a query by a field created within that same query (MS ACCESS)
The Query (For this question I do not think that you need to see schema): SELECT Agencies.AgencyName, (SELECT DISTINCT MAX(Invoices.CostsTotal) FROM Invoices WHERE Contracts.ContractID = Invoices….
How to retrieved parent object which haven’t children with specific values? Sequelize
Description & question Rentals is table with all registered rentals with start and end date as properites. After querying i want to get only this productGroups which have some products that don’t …
UPDATE all records from existing SELECT query
I have query to select data from related tables. SELECT s.id, CASE WHEN count(DISTINCT e.id) 0 THEN count(DISTINCT o.id) / count(DISTINCT e.id) END …
How to get next step
I have the table request_step with dummy info like bellow id,request_id,state,name,step_number *2,1,pending,step a,1 1,1,pending,step b,2 3,1,pending,step c,3 4,1,pending,step d,4 5,2,accepted,step a,…
Find out users who do not have a particular role
I have a set of DB roles defined in my oracle database. say VIEWER- Select only UPDATER – select & update only EDITOR – select & delete only BYPASSER- select & insert only And I have a …
SQL – remove trailing “/” in url with querystring
I have table with 2 columns where in one of them an url is stored. Now I would need to update the table to remove all trailing slashes from the urls, including urls that have a query string. …