Before asking my question I think it is better to explain about the table that I want to use.
In table A I have information about projects. Every year we create two project, season 1 and 2 and for example we show it 1234567121. The three first numbers are common for all , the next four numbers are unique and the three last numbers shows which year and season.For example: 1234856131
Part1: 123 are common for all
Part2: 4856 is unique and
Part3: 131 show 2013 season 1( The first six months)
For example in table A for projectnr that start with 1234856 I have:
I try to write an SQL query that when I run it shows me just projectnr from 2009 to 2013(1234856091,1234856092,1234856101,1234856102,1234856111,1234856112,1234856121,1234856122,1234856131)
In table A there are more than 100 projectnr with different numbers in Part2, for example: 1233621121,1239687122,1236995081,1236321111,...
Could you help me to write it?
to extract what you require from the database would be extremely stressful to the server the large your database grows, you would need to select each then with each run through a while loop to see if the numbers fit a pattern.
I would suggest a much simpler database setup, this would be a lot simpler and better in the long run