Skip to content
Advertisement

Tag: string

Set two decimal places after AVG function inside PIVOT

The output keeps being 95.000000 I tried using AVG( CAST(Grades AS Decimal(10,2) ) ) inside the pivot, and it keeps returning a syntax error about (. Tried using CAST AS DECIMAL inside the FROM subquery, but it just keeps putting the same 00000 output. CAST AS FLOAT works but I need two decimal places and it eliminates trailing 0s Using

Mysql comma seperated to json-array

I have some fields in the database that are comma selerated, something like: a,b,c,d,e and I want to convert them into: I know how to do it in nodejs / any other language, but I need to do it directly on the mysql Possible? Thanks Answer The simplest approach probably is to use string functions only: Basically this turns a

Count rows with equal values in a window function

I have a time series in a SQLite Database and want to analyze it. The important part of the time series consists of a column with different but not unique string values. I want to do something like this: I don’t know how to get the countValue column. It should count all Values of the partition equal to the current

Advertisement