I know somebody can tell me what I’m doing incorrectly here. This is a postgresql db. I’m trying to first sum the values in a column that share the same ID, and then add that total (coalesce) with …
I am new to SQL Server. I created a function which action like charindex
I am new to SQL server. I am trying to create a scalar-valued function which will act like charindex. but I am not so sure why when I call the function like it return 0 as result. Thank you so much for your help 🙂 have a great day guys Answer In SQL Server, you need to specify lengths on
Select Query is not working with WHERE clause when there is a space in column value
Select Query is not working with WHERE clause when there is a space in column value. since my table column value has space in it. When I copied same value from query result and put that with where clause, it doesn’t return any result. . if I run below query , it doesn’t return any result SQL Serve…
How to make a start on this SQL query homework? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question A mov…
All the migrations are working inappropriately
This is the error I get after trying to open the form. Below are the codes. It takes me all day so please kindly help me out. SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘id’ in ‘field list’ (SQL: select max(id) as aggregate from admissions where admissions.deleted_at is nul…
Have I normalized this database to a 3NF level the right way? [closed]
I had a lecture at college recently about normalizing databases, but since we are online I can’t really ask a lot of questions, so here I am. Can someone tell me if I’m doing the conversion right, if …
MySQL COUNT and IFNULL
I have tables like this: SQLFIDDLE I’m trying to count how many products are in each category SELECT `category_id`, `category_name`, IFNULL(count(*),0) cat_stat FROM `product_to_categories` …
How to sum transaction amounts for different time intervals in sql server?
Let say I have table called Transactions and have 3 following columns: Customerid TranscationDate TransactionAmount So I need to sum transaction amounts for each customer in different date intervals. …
How do a pivot on sql server on one column but renamed dynamics column
I’ve a table of prices With Reference, Price Category (Ex professional/Customer…) , the weight and the price Each article have X lines for same Reference, Price Category depend of weight I Want a return with Reference, Price Category, Price1,Price2… I try to adapt codes I’ve found but …
Updating joint query in Oracle
I’m trying to update the name on the trade table according to the user table however as we have so many trades I don’t want my query to update each and every trade. only the ones that have the …