Question: I have a string with the following content

```
http://www.mysite.com/test.php?http://www.anotherwebsite.com

```

how can i save the second url in a php variable?

i mean, the url after the interrogation mark.

Answer: 
The type of query result you want is better done via client-side display-time manipulations. You can trivially get your data with:

```
SELECT year, SUM(sales)
FROM sales
WHERE product_id = 1
GROUP BY year

```
```
SELECT PRODUCT_ID,YEAR,SALES,
LEAD(SALES,1) OVER (PARTITION BY YEAR ORDER BY SALES) AS FOLLOWING_YEAR_SALES
FROM TABLE_NAME;

```

You can use the above query to get a new column with the following year sales. for the difference between two-year sales is easy to calculate.