Error Number: 1055 Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column codelone.tags.post_id which is not functionally dependent on columns in GROUP BY clause; …
Tag: sql
How can I increment counter when the value in another column changes without sorting the column?
I have the following table And I need to be able to increment the counter value when the Name changes in SQL
ERROR 1452: Cannot add or update a child row: a foreign key constraint fails, Can anybody assist
I was wondering if anybody would be so kind as to try help me figure out th problem with my code. I have an extremially limited knowledge of sql I am a student and this is my first year doing sql. …
SQL – Count rows based on matching columns and value range
Please see below query using T-SQL with SSMS. There are three tables: B, G and L. B has a column Bname G has 2 columns Gname, Gross L has 2 columns Bname, Gname Gross column is an INT ranging …
can I place a sql query in a sql hana place holder
can I place a sql query in a sql hana place holder? the following query works: I am trying to pass something like the following: Currently getting a syntex error Answer As error says you, expressions are not supported for column view parameter: Can’t use column expression as column view parameter. Howev…
How can I select the max for a maths operation and also other elements without the max displaying all results
I am trying to find the maximum value of something, while also selecting other attributes at the same time. When i do the max statement on its own, it works as intended, but when I select another …
How to show the closest date to the selected one
I’m trying to extract the stock in an specific date. To do so, I’m doing a cumulative of stock movements by date, product and warehouse. select m.codart AS REF, m.descart AS ‘…
Combine table data in MySQL using JOIN
I’m trying to join two tables in MySQL, in one I have a set of IDs (of the type GTEX-14BMU-1526-SM-5TDE6) and a set of type’s of tissue(SMTS), I have to select the IDs for the tissue type ‘Blood’ (which is another column of the same table), and then I have to take only the first two st…
Change value in a cell and update another cell in MySql table using Update query
I have MySQL table with with 5 columns. Product_id, product_name, pack_size , price and price change. I have a requirement that if the value in price cell changes, it should update the cell value and save the updated value in price_change cell as well. For example, in the dbfiddle attached, in the row 1, if p…
MySQL query to find all child elements
I have two tables : elements : id_element name elem1 CPV elem2 CBO elem3 CPV parenting (Which is referencing elements) id_element id_element_elements elem1 null elem2 elem1 elem3 elem1 elem4 elem2 Is there a query to find all the child elements from a single element in this case ? Looking for something like :…