Select those record only from table 1 where city exist against state id in table 2 in PHP April 20, 2022 by Tarik Billa Try like this SELECT t1.* FROM table1 t1 JOIN table2 t2 ON(t2.state_id = t1.state AND t2.city!='') Browse More Popular Posts Routes in Codeigniter – Automatically Cocos2D 2.0 screenshots on iOS 6 Is there a way to take screenshot of a window in pyqt5 or qt5? Do I need to quote command substitutions? sizeof an array passed as function argument [duplicate] Sending CTRL-S message to a window Laravel collection converts array to object Change Icon For Tkinter Messagebox JQGrid: Loading data into the footer row Appending Pandas DataFrame to existing Excel document How to send multiple attachment in single mail in php (dynamic) Multiple spinners state/city Serving multiple domains in one box with SNI Objective C implementing a UIPickerView with a “Done” button How to calculate adjacency matrices in R Can I dynamically call a math operator in Ruby? For Next.js Dynamic Routes, it is possible to combine a string with a [slug]? ISO C90 forbids variable length array What do < and > mean such as implements Comparable? Powershell script to remove double quotes from CSV unless comma exists inside double quotes