skip to Main Content

Flatten JSON object in MYSQL

I have a table with 1 column and rows like - Row- {'category': ['mobiles'], 'specs': ['4g', '2gb ram']} Row- {'category': ['computer'], 'specs': ['2gb ram']} I want to flatten the data into 2 columns- category, mobiles specs, 4g specs, 2gb ram…

VIEW QUESTION

sub query from same table mysql

I have questions about sub query. I have table: Emp_ID Date_Entry Clock_In Clock_Out E-0001 2024-02-01 2024-02-01 22:01:00 NUll E-0001 2024-02-02 NULL 2024-02-02 06:01:05 E-0001 2024-02-03 2024-02-03 06:01:00 2024-02-03 14:00:20 E-0001 2024-02-04 2024-02-04 08:00:00 2024-02-04 17:01:05 how to query with mysql…

VIEW QUESTION

Laravel eloquent GROUP BY

I have four tables: supplies, stocks, stock_ins, and stock_outs. In the Stock controller, I want to sum the total stock_out for each supply . For this, I have used the following query: $supplies = Stock::select( 'supplies.name', 'stocks.supply_id', 'stocks.id', 'stocks.stock', 'stock_ins.quantity…

VIEW QUESTION
Back To Top
Search