ru129 Posted November 9, 2014 Share Posted November 9, 2014 perId propId firstName lastName 1 1 Fred Bloggs 2 2 Arthur Brown 3 1 Mary Bloggs 4 4 Nigel Wilson How would you write an SQL query to list the postcodes and the names of the occupants whose last name begins with a “B in the table above Quote Link to comment https://forums.phpfreaks.com/topic/292380-sql-query/ Share on other sites More sharing options...
Barand Posted November 9, 2014 Share Posted November 9, 2014 I wouldn't. There is no postcode. Quote Link to comment https://forums.phpfreaks.com/topic/292380-sql-query/#findComment-1496179 Share on other sites More sharing options...
ru129 Posted November 9, 2014 Author Share Posted November 9, 2014 propId postCode 1 CB1 4PY 2 CB2 9GH 3 CB23 4DG Quote Link to comment https://forums.phpfreaks.com/topic/292380-sql-query/#findComment-1496180 Share on other sites More sharing options...
ginerjm Posted November 9, 2014 Share Posted November 9, 2014 You must like being cryptic. So - did you just reveal a second table or additional fields in the first table? Maybe you could start over and use more real words to describe your situation? Quote Link to comment https://forums.phpfreaks.com/topic/292380-sql-query/#findComment-1496183 Share on other sites More sharing options...
NotionCommotion Posted November 9, 2014 Share Posted November 9, 2014 Don't understand your tables, the the general approach is to JOIN your tables, and then use the LIKE keyword. Quote Link to comment https://forums.phpfreaks.com/topic/292380-sql-query/#findComment-1496184 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.