I have sql select:
SELECT *
FROM `fclients` AS F
LEFT JOIN `fclients_sequens` AS FS ON F.category = FS.category
ORDER by FS.num
AND I get results:
Then, for given id in first table, I make sql query:
SELECT *, fclients.id as fclientsID
FROM `fclients` AS F
LEFT JOIN `fclients_sequens` AS FS ON F.category = FS.category
ORDER by FS.num
and I get an error:
#1054 - Unknown column 'fclients.id' in 'field list'
Tell me please how give id fist column (id=37)?
You need to use the alias F when you reference the column ID
SELECT *, F.id...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With