Skip to content
Advertisement

Category: Questions

Using subquery with update SQL

I have Table 1 : EMP as below Table 2: EMP1 ID is the Key and is common in both the files. I want an Update SQL to update the amount field of Table 1 using Amount field of table 2, which gives the result as below. Result: Answer One method is a correlated subquery: You can check if the

Data from 2 tables is not displaying on the same page

I’m a newbie in PHP and mySQL, I’m currently working on a profile page where I will display the logged in user’s personal information from one table called users and also display the tours that they will book in the future from my website from this table: booking I’m fetching the data from users table with prepared statement which will

postgresql remove last 4 characters from text values

I have a table with only one column that has multiple text values. All of them end with same 4 characters that I would like to remove. Could anyone, please, help me with a query for that? I’ve already …

How to check how many issues are opened daily in SQL

I have data from issues in a table with the following schema. I want to know how many issues are open every day using PostgreSQL. We consider an issue being open at date x if: x >= created_at x <= deleted_at There may be days where no issues were created or deleted, as in the example. How can I do

Trying to update Date Format from (DD-MM-YYYY) to (MM-YYYY) SQL

I’m trying to update my date column which is (eg. 2012-04-20) format in into mm-yyyy. I searched for solutions that you can do by converting to varchar however it gave me an error Msg 241, Level 16, State 1, Line 4 Conversion failed when converting date and/or time from character string. This is the code I’m executing Any idea how

How to use IS NOT NULL on a case when?

I have the below SQL query in SSMS where I want to exclude NULL rows that show up in the ‘intercompany budget’ columns. I’ve tried to search for answers and putting a WHERE clause for ‘Intercompany Budget’ IS NOT NULL, like in the query below, but NULL rows still show up. Any suggestions? Thanks! Answer ‘Intercompany Budget’ IS NOT NULL

Advertisement