Category "sql"

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102 [closed]

I am receiving the error of SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102 i

Return Monthly Revenue based on a start and end dates

I am looking to create a query that would return the individual monthly revenue for the next 12 months. The revenue amounts are currently stored by projectid an

The datetime columns in all the tables on SQL server have shifted by a few hours

I've created a few tables all of which had a column of datatype datetime. Recently, I think after the daylight savings adjustment, for some reason all the dates

postgreSQL - fill in blank date rows per ID

I have a table which looks like this: ID money_earned days_since_start 1 1000 1 1 2000 2 1 3000 4 1 2000 5 2 1000 1 2 100 3 I want that rows, without a days_s

List all table origin columns for all views in Oracle database

Let's assume I have following tables: TABLE_A (ID; NAME; ...) TABLE_B (ID; NAME; TABLE_A_FK; ...) And I expose the table data through this view: SELECT a.id, a

How to get the partition column names for a table?

I have a table that is partitioned on one or more columns. I can do ... SHOW PARTITIONS table_db.table_1 which gives a list of all partitions like this, year=2

PHP array filled by a MySQL query [closed]

I need to fill multiple different arrays by using a MySQL query. This would have up to 16 different arrays. I want to specify each array with

Is the logic and the implementation of this query correct?

So i have a table that logs users using certain apps. It has the fields below id time app user server type (can be IN or OUT) So a user starts using a certain

SQL Query to fetch data as of the year,quarter or month passed in parameter

I have the following query- (SELECT DISTINCT accrual_period FROM anc_per_accrual_entries a, anc_per_plan_enrollment b WHERE a.per_pla

SQL query for view contribution percent

I have to calculate % contribution for each category. select portfolio,Portfolio_views,Portfolio_views/total_views*100 as perc_contribution from ( select categ

Clickstream performance Scoring formula using SQL

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

log the procedure call messages into a table in postgress

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

How do I recursively select rows where values in one column are present in another column?

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

Is there a way to return collection instead of entity in @Repository's @Query

I have a query: @Query( value = "select name, age, now() from received.scheme ;", nativeQuery = true ) public {???} selectData() I cannot create or r

What is the data type in ASP.NET Core for decimal(18,2) in sql

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

Symfony doctrine specify fields in ManyToOne to improve performance?

For example i have a simple entity "Cars" with a ManyToOne relation "Brands". class Brands { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\C

Lookup value in Query

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

Learning MySQL with PopSQL and wanted to carry on with a tutorial but I cant connect to my database. Error 1049 No connection

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

SQL query how to find the average number of rental books for each quarter

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

How to convert iso 8859 string to UTF8 in a postgresql 12 database?

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