Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Sql statement help

$
0
0
Hello good day,-

Please can you help me generate SQL statement in my problem,-

I have a table named "freights"

| ID | MODE | DESTINATION | ORIGIN |
|---|-------|--------------|---------|
| 1 | SEA | JAPAN-------| CANADA |
| 2 | AIR | PHILIPPINES | CANADA |
| 3 | LAND | PHILIPPINES | CANADA |
| 4 | LAND | PHILIPPINES | CHINA |
| 5 | LAND | PHILIPPINES | CANADA |
|---|------|-------------|----------|

now, i want to display

DESTINATION ------------| SEA |------| LAND |-----| AIR |
JAPAN-----------------------1
PHILIPPINES------------------------------ 2------------1

why 2?,- becoz i only want to display origins like CANADA not CHINA....

i know and i believe that there is away to do this in sql.. i think it uses COUNT() but i dont know how.. please???..

Viewing all articles
Browse latest Browse all 13329

Trending Articles