Question: I have two databases with different structure.

Table 1:

```
ch_code    ch_def    ch_weight

```

Table 2:

```
address    ch_code

```

I need to merge this two tables, so the structure would look like:

```
ch_code    ch_def    ch_weight    address

```

The number or rows in two tables are different (table 1 has more data).

Should I use `merge`, `union`.. something else?

Thank you!

Answer: 
```
var foo = '24235235adasd_4.jpg';
var bar = foo.substr(foo.lastIndexOf('_') + 1);

```

\*Make a note to yourself that this wont work with those uncommon files that have an '\_' in their extension (for example, I've seen some that are named `filename.tx_`)
```
var end = filename.replace(/.*_/,'');

```