skip to Main Content

How to run raw query in Laravel – Phpmyadmin

How can I write the below raw query in Laravel $result= DB::select('SELECT a.awb_number,a.full_awb_number,a.service_type, b.city AS From_city, c.country_code AS From_country, b.city AS To_city, c.country_code AS To_country, datediff( max(s.created_at), min(s.created_at)) as Aging FROM customer_shippments a LEFT JOIN addresses b ON a.from_address =…

VIEW QUESTION

Unknown column in 'on clause' – tried both where and having conditions but same error – Phpmyadmin

SELECT hh_podcast_channel.id FROM hh_podcast_channel inner JOIN ( SELECT hh_podcast_episodes.podcast_id, ROW_NUMBER() OVER(PARTITION BY hh_podcast_episodes.id ORDER BY hh_podcast_episodes.published_on) as rn FROM hh_podcast_episodes ) as t2 ON hh_podcast_channel.id = hh_podcast_episodes.podcast_id having t2.rn = 1 #1054 - Unknown column 'hh_podcast_episodes.podcast_id' in 'on clause'

VIEW QUESTION
Back To Top
Search