I have to calculate % contribution for each category. select portfolio,Portfolio_views,Portfolio_views/total_views*100 as perc_contribution from ( select categ
imagine we have a clickstream and we want to have some everyday score that follows next rules: increase by 1 each impression increase by 10 each click decrease
I want the log the execution message of a running stored procedure into a table in postgress --example: create or replace procedure ccc () language sql as $$ in
I have a table like below with two columns Person and Supervisor. Person Supervisor 1 3 2 3 3 4 I want to select rows where the Supervisor column only has val
I have a query: @Query( value = "select name, age, now() from received.scheme ;", nativeQuery = true ) public {???} selectData() I cannot create or r
I have a Amount column in database which is in Varchar datatype, I am retrieving the data from table and I am casting for the amount should be returned as (123
For example i have a simple entity "Cars" with a ManyToOne relation "Brands". class Brands { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\C
I'm trying to replace the local variables i've declared below to capture them in calculated columns. So the [YTD] column would look up Today's Date - 1 and retu
I opened PopSQL and the there is a red dot at my connection. If I go into it and test it, it tells me Unknown database 'giraffe'. I opened mySQL and typed 'show
I am trying to find the average number of rental books for each quarter. Rental(RegNum, DateBorrowed, DateReturned) Books(RegNum, BookName, Category) What i am
EDIT : I think I was not clear, I am sorry for that : I have a column with bytea data. This column, when I apply encode(column,'escape') to it, I got text in th
I have a db where a foreign key references my primary key, Ill like to select all rows where the foreign key is NULL and then add rows with a foreign key as nes
I'm trying to join two tables in SQL. I want to join on the column with the last four digits of a phone number with the a column from a second column where only
The DB was Sybase. I executed update SQL statement like UPDATE table_name SET smallint_col = 0, datetime_col = CONVERT(datetime, '1999-09-09') WHERE some_col =
I have a table containing several kilometers about 100 table of kilometers I need to rotate rows into columns like this pivot rows into columns The number of co
I am using postgres DB and i have table with two column name and sal . name Sal Raunak 10000 Raunak 5000 Rahul 500 Raunak 300
tl;dr; Will the query optimizer be able to optimize the max calls? select id , max(case when this and that11 and that12 then 1 else 0 end) name1 , max(c
Note: This is an over simplified version of what I am trying to do. Let's say I have a table called USERS that has FIRSTNAME, LASTNAME. Contents are: JOHN SMI
I'm working on this sql challenge, but I don't know if the way to get the top 1% of soloists calculated by the total number of concerts performed. is correct. P
I am looking for some help. I need to create a dependent dropdown based on the previous input. Everything works in my code, and it sends and receives data from