Category "sql"

calculating the average of marks from the beginning to this record

i have a table named test with the below structure like this id mark join_id 1 5 1 2 4 1 3 9 1 4 5 2 5 7 2 6 12 2 i want to write a que

SQL GROUP BY and COUNT and conditional SUM with column value

Here is an example of my table. ┌────────┬────────&#

SQL: how to convert timestamp to datetime? [closed]

I need to convert "2022-04-29T07:20:32.727Z" to "2022-04-29 07:20:32". I am quite new to SQL and haven't found the solution.

What is the best way to use for large numbers in phpmyadmin, as the number I need it not show in the correct way

I am trying to use phpmyadmin to add numbers to sql my column is at the moment double, but it does not give me the correct info. Did try decimal and binary als

how many rows will the query return?

table t has a field X which is the primary key. the table has 5 rows. how many rows will the query returnenter image description here

How do I use fetchAll in php?

I am using this statement to fetch the elements in a column in my db $result = $stmt->fetchAll(PDO::FETCH_COLUMN, 0); but I get this error when trying to

Combining cte with dates and table with dates between two dates

I have a few pieces of code that give me things that I need, but I need some help for put them together. I have: create table #test ( job int, dateL date) inser

SQL - Returning all transactions based on one value

Using a large table of retail transactions I am trying to review customer purchases where they bought a specific product category. Table example below, customer

Get specific rows only after comparing with previously added rows on different date

There is a table which has multiple fields including a Date column at which the current record gets updated. Col1 Col2 Col3 Date A X1 Y1 Today B X2 Y2 Today C

IBM SPSS How to import a Custom SQL Database Query

I am looking to see if the capability is there to have a custom SSMS sql query imported in SPSS (Statistical Package for the Social Sciences). I would want to b

How to select most frequent value with condition for multiple columns in netezza?

I want to get the most frequent value for each column. If it has the same frequent it will return 'equal'. I have data like below table and I use netezza. numbe

How do I get a data from one table to another but with calculations?

I have two tables: "Customer" and "Order". The "Customer" table has an attribute called noOfPurchases, and the "Order" table has an attribute called quantity. H

Why does this Sql query shows the possible changes but does not implement it?

So, I want to change the prefix of my tables and the following command shows the possible changes that will take place which seems alright but does not seem to

Are indexes built CONCURRENTLY different in any way?

Does PostgreSQL CREATE INDEX CONCURRENTLY mean that even after initial index build, new and future inserts won't be indexed immediately (strongly consistent in

SQL Update query via VBA using ODBC connection

I have an ODBC connection to a database set up in Control Panel using a DSN. I can use this to see data from tables and Views in Excel. What I need to be able t

SQL Join is Returning Multiple Rows

Below is a Snowflake query that is trying to get the serial number that's associated with each account name (ACCT_NAME), account ID (ACCT_ID), SKU ID (SKU_ID_p2

How to filter out NULLs in a Hive query?

Table is: Result should be: How can I solve this query? hive\> select \* from xyz; OK xyz.col1 xyz.col2 xyz.col3 NULL b c a NULL c a b

How to use Python-Operator % for multiple values?

I'm trying to fill an SQL database with soma data, measured by an bme680. Therefore I'd like to format the measured values like this: print ("Temperatur: %0.1f

Query for parting columns by theys dates

I already asked my question but I will try to give more detail and explication. So I need to do somme report on a SAP Web Intelligence systems. I can import my

Is it possible to write a comment after a ';' in an SQL query?

In this code: SELECT * FROM Customers ORDER BY CustomerName ASC; -- some comment If a comment is not part of the query/code, why can't I write it after the ';'