[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] sql inner join problems
>
> Hi, I am trying to run a simple sql query that does an inner join for two
> tables.
>
> Example: [query sql="select merchandising.sku, products.description from
> products inner join merchandising on products.sku=merchandising.sku"
> type=html]
>
> How ever I can't seem to get it to work. I've read through the docs, and
> mailing list to no avail, so I'm sorry if this question is lame, but all I've
> got is brain farts.
>
> Background info: I am using the foundation template with this just so you
> know the table layout. The Interchange version is 4.8.3.
>
Try this instead:
<table>
[query type="html" sql=|
SELECT m.sku, p.description
FROM products p, merchandising m
WHERE p.sku = m.sku
]][/query]
</table>
If you still have trouble then please specify which database system
you are using, what error messages you get etc.
As a general rule of thumb, if a query fails when using an SQL
command-line tool then it will fail in Interchange.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/