Skip to content
Advertisement

Tag: database

Strange variables MySQL [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 11 months ago. Improve this question Can someone tell me what “skip_name_resolve” and “skip_grant_tables” MySQL variables do

SQL Insert into duplicates

My code is as follows: I should explain the SUM(), there are differing dates on schedule such as I want to get all the “count” of “serviceId” beyond today hence the ‘date >= GETDATE()’ Basically I want the table to look like so: I am able to get the values but I get them like so: Whereas I want to

SQL MAX on primary key, is filter condition unncessary if it is already indexed?

id is the primary key. Is date(created_at) = ‘2021-11-05′ and time(created_at) > TIME(’04:00:00’) filter condition unnecessary for Max function since studenthistory is already indexed on class_id and student_id? The only reason I added that datetime filter is because this table will get huge over time. (historical data) And I wanted to reduce the number of rows the query has to

Take last value in sequence

I am trying to insert data into my target table from my source table where in the target table I have an additional column called SaleTo. SaleTo = the SaleFrom based on the MAX SaleSequence. Example of the source table: SaleNo SaleFrom SaleSequence 1 Alabama 2 1 Minnesota 1 1 Virginia 3 Example of target table: SaleNo SaleFrom SaleSequence SaleTo

Join mysql table with distinct value from another table

I encountered a problem on a database I am working with. I have a table of counsels which may hold repeating values, but their is an enrolment number filed which is unique and can be used to fetch them. However, I want to join from a cases_counsel table on the “first” unique value of the counsel table that matches that

Column or global variable not found db2

I have a issue with DB2. I have two libraries with the same structure database. The only one difference is the data. When i try this sql request for the first library, it’s work but when i try with the other library, i have this error. I check the CLIENT and EMPLOYE tables and they have the column with data.

Delete duplicate records on SQL Server

I have a table with duplicate records, where I’ve already created a script to summarize the duplicate records with the original ones, but I’m not able to delete the duplicate records. I’m trying this way: The idea was to take the last record of each COD_PLANO_PAGAMENTO and delete it, but this way all the records are being deleted, what am

Advertisement