|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help displaying only part of a postcode field .....
Hi gurus,
I need to select records and group them according to the first 3 digits of the postcode .... eg n20 3456 n20 4345 n20 1212 n21 1234 n21 4321 Need to display N20(3) N21(2) Any ideas - I have got it diplaying ALL the data with the count - how do I filter and group the N20's and then N21's etc.... ?? TIA 54 |
|
#2
|
|||
|
|||
|
This will help
I think that this will solve your problem
SELECT COUNT(*) AS total, postcode FROM table GROUP BY LEFT(postcode,3) ORDER BY postcode;
__________________
Regards, Ramiro Varandas Jr. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Need help displaying only part of a postcode field ..... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|