Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago. Improve this question I’m trying to sum the values of two columns into a new one, its for analysis purpose (not creating a new column in the database)
Tag: database
SQL query to filter columns
I have a question regarding the SQL query. I have this table shown below Region Rep Item Quebec Jones Pencil Ontario Kivell Binder Ontario Jardine Pencil Ontario Gill Pen Alberta Sorvino Pencil Quebec Jones Binder Ontario Andrews Pencil Ontario Jardine Pencil Alberta Thompson Pencil Quebec Jones Binder Ontario Morgan Pencil Quebec Howard Binder Alberta Sorvino Pen Alberta Thompson Binder Ontario
How do I parameterize table & column in a Postgres-custom-function, selecting PK if value exists, otherwise insert it and return PK anyways?
Trying to do what I specified in the title, I already got the upsert-functionalities working, however when I try to parameterize it, I’m just out of my depth and can’t debug it. My query: now when I try to use the function, I get: What puzzles me about this is the fact that this syntax works fine in an unparameterized
How to autofill a column with sequential number, but based on a parameter?
I’m trying to add a new column to few MySQL (MariaDB) tables. I want to make the column auto-filled with sequential number. What I figured out so far is: It works perfectly. However, I don’t know how to make it so that the order in which the numbers are assigned is based on another value, namely ascending order of another
How to let user only delete their details and no one elses php
I created a very basic site where a user logs in and then has access to a table that they can edit. I want the user to be able to only delete their own details and no one elses, and I don’t know what i’m supposed to add to the delete page so it only deletes the details of logged
SQL: is there a way to count the number of values from a table if there are none?
So i have 2 tables, one its “Movies”(movie,type,lenght) and one “Cast”(title_movie,id_actor) and i have to count in how many “SF” Movies every actor played. I tried this: and it only shows me the actors that has at least 1 SF movie, the ones with 0 movies are not displayed. Any ideas? Answer LEFT JOIN to get all actors. To count
Make table out of different columns and assign values to add them up
I want this: where a win equals 3 points, a win in PV equals 2 points and a lose in PV equals to 1 point, to show like this: I just can’t figure out how to connect the values with SQL-Statements! Any help is appreciated 🙂 Answer You can do: Alternatively, you can filter out rows first and aggregate at
DB2 SELECT from UPDATE Options
I am currently trying to do an However, the version of DB2 I have does not appear to support this Is there any alternative to this in DB2 that could be return a desired result? Where in one query we can Update and Return the result? EDIT – The Select statement is supposed to return the values that are to
Find value that is not a number or a predefined string
I have to test a column of a sql table for invalid values and for NULL. Valid values are: Any number and the string ‘n.v.’ (with and without the dots and in every possible combination as listed in my sql command) So far, I’ve tried this: The regular expression also matches the single character values ‘n’,’N’,’v’,’V’ (with and without a
Get data from database and write it back in again
I have written a function by reading an excel file and writing it to the database. This works! Getting data from the database also works. Where I get stuck is at the point that the function should read each row, calculate it and write the result back to the database. I also want to find out how many rows were