Skip to Content Skip to Menu

[SOLVED] Query field display with multiple columns and same names

  • activha
  • activha
  • ONLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
3 years 10 months ago - 3 years 10 months ago #321907 by activha
Hello

I have the following query in a query field
Code:
SELECT * FROM `#__invoices_invoices` AS `i` LEFT JOIN `#__invoices_contacts` AS `co` ON (`co`.`id` = `i`.`user_id`) LEFT JOIN `#__users` AS `u` ON (`u`.`id` = `co`.`user_id`) WHERE ( `u`.`id` = '[user_id]' ) AND `i`.`type` = '1' ORDER BY `i`.`real_invoice_num` DESC LIMIT 24

And I'd like to display the id as [column_id] but doing this displays the user id instead of the invoices table id.

Can you tell me what I'm doing wrong here ?
I tried to write [column_i_id] but no luck neither

Thanks
Jean
Last edit: 3 years 10 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • activha
  • activha
  • ONLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
3 years 10 months ago #321908 by activha
Ok replying to myself the solution was simple
Code:
SELECT i.id,invoice_date, auth_code, invoice_num, computed_total, computed_status, co.company

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum