TABLE: NAME : Jance C hiatt, Sam, Brook, Newyork, London ADDRESS : NULL,NULL,NULL,NULL NewYork and London should be address column but it is showing on Name itself Here address is not coming at the separate column of database. Kindly tell me what issue I am facing Answer Each insert statement creates new rows…
Tag: mysql
Return in which or statement results are from SQL [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’m having the following SQL statement, to return worksheets that teachers have liked, …
MySQL convert timestamp and time string to DateTime format
In my table have two columns, one as timestamp to save the date and one as time string to save the time with period. Eg: I want to combine them into one column as DateTime format in the result then order by desc on that column. Here is the example: http://sqlfiddle.com/#!9/25eb21/4 The column name ‘Date…
Getting sum of two rows in an inner joined table
I have these two tables; trips id date revenue 1 01/01/2020 5000 2 01/01/2020 3000 3 02/01/2020 4000 4 02/01/2020 2000 expenses id tripid amount 1 1 500 2 1 300 3 2 400 4 2 200 5 2 700 I would like to get the sum of revenue collected in a day AND sum of expenses in a day.
SQL query to create a merged table with varied timestamps and varied column mapping
I am trying to write an complex mySQL query in which there are 2 tables action and revenue what I need is: From auction table take out location, postal code on the basis of user, cat_id, cat and spent and join with revenue table which has revenue column so as that given cat_id, cat and date I can figure out
SQL – Select records where columns include the keyword and have the same category
I’m working on a search bar. I have two fields category and input. If the user types the query and doesn’t select a category I want to get all records matching the keyword. I’ve done it and it’s working perfectly. Now If the user select a category with the keyword. I want get records w…
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. …
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 :…