जब मैं mysql में कोई तालिका बनाने का प्रयास करता हूं तो मुझे एक त्रुटि मिलती है।ERROR 1005 (HY000): तालिका नहीं बना सकता (errno: 150)
इसे हल करने पर कोई सुझाव?
create table stock_in(
ind int not null auto_increment,
itemcode varchar(10) not null,
quantity int not null,
description text not null,
sales_ref int not null default -1,
return_outwards_ref int not null default -1,
stock_in_receipt_ref int not null default -1,
date text not null,
time text not null,
username text not null,
foreign key (sales_ref) references sales (receiptno),
foreign key (return_outwards_ref) references returnoutwards(ind),
primary key (ind)
);
त्रुटि:
ERROR 1005 (HY000): Can't create table 'posinventory.stock_in' (errno: 150)
क्या आपने अनन्य कुंजी के साथ 'बिक्री' और' वापसी-आउट' टेबल 'बनाई हैं? सभी टेबल InnoDb होना चाहिए। – Devart
@Devart: धन्यवाद, मुझे मेरी गलती मिली ... ऐसा इसलिए है क्योंकि बिक्री तालिका में प्राप्तिनो प्राथमिक कुंजी नहीं है ... मुझे इसे प्राथमिक कुंजी के साथ एक नए कॉलम में संदर्भित करना चाहिए, उदाहरण के लिए, sales_no – Boon