1
是否可以將行號作爲ID返回? 在我看來,其中i合併我的表,我不能做一個唯一的ID,因爲我需要創建左 加入到存儲的每一個值:斯芬克斯搜索結果中的行號爲id
CREATE VIEW
sphinx
AS
SELECT
company.company_id,
company.company_name,
company.company_keywords,
company_address.address_street,
company_address.address_number,
company_address.address_telephone,
company_address.address_fax,
company_address.address_email,
company_address.address_website,
company_address.address_authorized,
company_contact.contact_name,
company_contact.contact_surname,
company_contact.contact_telephone,
company_contact.contact_mobilephone,
company_contact.contact_fax,
company_contact.contact_email,
company_page.page_content,
company_page.page_description,
company_page.page_keywords
FROM company
LEFT JOIN company_address ON company.company_id = company_address.company_id
LEFT JOIN company_page ON company.company_id = company_page.company_id
LEFT JOIN company_contact ON company.company_id = company_contact.company_id
當我收到的行數我可以這樣做SELECT * FROM sphinx LIMIT 1 OFFSET rowNumber 以獲取該行的信息。
謝謝你的時間。
它確實有效..謝謝!你能解釋一下有什麼事嗎? – Sem 2012-03-29 12:17:37
@Zundrium編輯我的答案。 – fancyPants 2012-03-29 12:55:37