skip to Main Content

MySQL: join tables based on table name as a column value

Below is the database base snippet of the database that I am currently working on. Table transactions: id reference_table reference_field reference_id created_at 1 online_recharges online_recharge_id 10 2024-01-31 2 online_recharges online_recharge_id 11 2024-03-03 3 wallet_deductions wallet_deduction_id 10 2024-02-01 ... ... ...…

VIEW QUESTION

mysql breadcrumb with multiple joins

I would like to select all active categories and view it with a breadcrumb. In my database I have the following: id_category category_name velleman_id velleman_parent prestashop_category prestashop_category_2 prestashop_category_3 prestashop_category_4 deleted 1 Car & Bike 10 0 2 Bike 10.10 10…

VIEW QUESTION

Phpmyadmin – why multiply two column in sql is not equals to sum(column1 * column2)

if have these tables : orders(amount,unit_price,child_amount,child_price,service_id,issue_date,is_success) pools(name,for_view) services(id,pool_id) when i run this sql : SELECT SUM(orders.amount) AS totalAmount, SUM(orders.unit_price) AS totalPrice, SUM(orders.amount*orders.unit_price) AS total, SUM(orders.child_amount) AS totalAmountC, SUM(orders.child_price) AS totalPriceC, SUM(orders.child_amount*orders.child_price) AS totalC, pools.name, pools.for_view FROM orders INNER JOIN services…

VIEW QUESTION
Back To Top
Search