I have a table: table1 u_a_id element_id my_seq line_num 1 HI01-01 1 30 1 HI01-02 1 30 1 HI01-01 1 31 1 …
how to show all result query even though the results are empty
I count my data from database, but I have a problem with the result. the result only displays data that is not empty, while the empty data is not displayed. how do I display data rows that are empty …
Change WM_CONCAT function to LISTAGG
I used WM_CONCAT in my sql query. The database has been updated to version 12c and WM_CONCAT doesn`t work. Query had value: Select r.product_id, count (1) how_many, wm_concat (distinct r.number) …
SQL OPENQUERY, Incorrect syntax near ‘+’
I have this sql query: DECLARE @VAR varchar(8) SET @VAR = ‘20140202’ SELECT * FROM OPENQUERY([NMD],’SELECT * FROM NmdItemGroups01.dbo.InvTranDtl WHERE TranDate = ”’ + @VAR + ””) But when I run …
How to get Sum of many columns as one
am working to get percentage of GSM , DEPOT , IPMSAN ..Etc and I would like to sum the counts within each column that correspond to each WITH q2 AS ( SELECT c2.compteur, c1.police , ( SUM(c1….
SQL join results from GROUP BY and COUNT in 2 tables
Table 1 (VID is unique) VID|UID 99 | 11 56 | 12 52 | 11 24 | 13 14 | 13 To count the records by UID, SELECT count(*),UID from t1 GROUP by UID ———— count(*)|UID 2| 11 1| 12 …
MySQL first_value on varchar column returns records in wrong format
first_value function in MySQL returns varchar column in unexpected format. I got a table ‘test’ with two columns create table test (col1 varchar(10), col2 integer); and has records like this, when …
Rounding time in Python in SQL
how to get round of last hour between last hour and exactly 1 hour before , for example if now the hour is 14:10 the anser i am looking fir is give me all record between 13-14:00, my code is only for …
Uncaught PDOException: SQLSTATE[HY093] [closed]
I get this erro: Invalid parameter number: number of bound variables does not match number of tokens in C:xampphtdocsPHPtennisronde2-wijziging.php:59 // code van het knop wijzigen if(isset($…
how to solve this query using union
Display id and name for salesmen along with id and category of products in a single table. Indicate the source of the row in result by adding an additional column TYPE with possible values as ‘S’ (Salesman) and ‘P’ (Product). Display all rows. I don’t how to add column “typ…