Skip to content

update join with where

I need to update a certain alert on a loan where the obligor and obligation is something, but I can’t figure out what I’m doing wrong in the join. This seems to update all alerts in the table rather than the specific one I want. We are using postgresql db Answer Workbench usually refers to MySQL. …

Data inserting in between the rows in table

I have a table which has around 1,000,000 records. I noticed that when I insert a record it does not get inserted at last instead it gets inserted in between Example My table (testing) Si. Name. Address. 1. Test. 1/2 test 2. Test. 3/4 test Si has a unique index created but no primary keys defined So when I ma…

Need help finding syntax error in SQL code [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 9 months ago. Improve this question I have been trying to follow along with a SQL tutorial on YT. Every …

Accurate DateDiff

I have 2 time fields in SQL. I want to calculate the difference between start time and end time in hours. From 7 AM in the morning to 7:30 PM it would be 12.5 hours but the datediff function returns 12 hours because it returns an integer. I also tried converting it to seconds: All of these return 12 hours

MySQL: Error 1045 – how to set correct rules?

I have MySQL db and need to create a new database. However, I can not do it since I keep getting the 1045 Error. shows following: I don’t even have enough rights for rewoking and granting or creating a new user. Could you please help me what to do? Answer You only have privileges on a schema named db. Y…

Order by multiple columns in the SELECT query

How can i order the results in my select query to have them like this? I tried this query but the result is not what I’m looking for: In which col1 represents the first number, col2 is the second one and col3 is the last number in the above example. This query returns: Thanks Answer Sort should be 1-3-2…

MySQL Difficult Where Clause

I need help with a difficult query which I may not explain well with words. The query needs to only return results where all the characters in the code column are in the where clause. Say I had the following table and wanted to return the code and position where ABC. Table: code position ABC 100 ABCD 200 ABCD…