I have Faced group by some id and Sum other column json_encode data in select query MySQL. But how to sum total json data value? Please help Anyone… Using this, PHP 7.2, Mysql 5 and Apache 2. …
Tag: sql
XML load is slow. Using text() when reading XML file with attribute-centric mapping
I am reading in an XML file into the database. It works fine however it is very slow. I was wondering if I can use text() in order to speed the process up similarly to the solution in this post: Xml …
Need help joining 2 tables and rolling them up in a unique way using BigQuery SQL
I have 2 tables at different granularity in a BigQuery dataset. I need to join those two and roll it up using BigQuery SQL in such a way that the value in one of the columns of the 2nd table becomes …
Application login system not working SQL LOCAL
I’am doing my program and i need login and register system. My register system is working but login not. I have done register system SqlConnection sqlCon = new SqlConnection(“Data Source = (LocalDB)…
Remove character from dynamic string
I have a file with some junk values and i need to get rid of them while loading that file into a table. Giving here some example. File is semicolon separated, and last column has those junk values. …
Dividing by decimal values – rounding issue
I’m trying to divide two decimal values, in hope they will return the following; 1.132930. However, SQL appears to be rounding the value to 1.132931. The value returned before conversion is 1.1329305135951. The SQL code i’m using is as follows: Answer You can round the value before the cast as fol…
SQL Combining two different tables
(P.S. I am still learning SQL and you can consider me a newbie) I have 2 sample tables as follows: Table 1 |Profile_ID| |Img_Path| Table 2 |Profile_ID| |UName| |Default_Title| My scenario is,…
Adding percentage to number in SQL
I would like to add a percentage sign after a number in SQL. This is the query I have select cast(vetted as float)/cast(account_create as float)*100 from numbers I have tried using the format …
Filter rows over partitions
Suppose I have the following table: +——-+————+ | nGroup | Status | +——-+————+ | 1 | DONE | | 1 | UNKNOWN | | 1 | DONE | …
concatenate columns based on blank columns
I am having three columns,- and / should be used as separator result should come in new column(File Index-sub Index/Year),if sub index is blank then result should be (File Index/Year). SELECT [ …