Good day Sir/Ma’am, I need help regarding on Join clause is it possible to use join clause in multiple column names from other table with foreign key?
Problem: I have table named
Table 1: ‘biditem’
COL.1: biditemid(pk)
COL.2: user_id(fk)
COL.3: product_id(fk)
COL.4: bidamountprice (decimal)
COL.5: bidtime (datetime)
Table 2: ‘user’
COL.1: user_id(pk)
COL.2: user_firstname (varchar)
COL.3: user_middlename (varchar)
COL.4: user_lastname (varchar)
Table 3: ‘product’
COL.1: product_id(pk)
COL.2: product_name varchar(25)
I want to display from the biditem look like this in php

>Solution :
You can also write your query like
select
b.biditemid,
concat(u.user_firstname,' ',u.user_middle,' ',u.user_lastname) as name,
p.product_name,
b.bidamountprice,
b.bidtime
from
bitem b,
user u,
product p
where
b.user_id=u.user_id
and b.product_id=p.product_id
- name your table with alias
short form - always remember for joining if you have 3 tables then 3-1 will be your minimum
whereclauses to make proper join with your all tables - likewise you had 3 tables so the minimum number or where clause use was 2 in your above code.
You can use that standard and you can use left inner, outer join too whatever you are comfort in. Both standards can be use in oracle sqlplus, mySql, postgreSql