开发者

Proper mysql syntax

I have no clue as to how to properly write this in raw sql, so I'll try and supply as much 开发者_运维技巧clear information as I can.

Goal in "english"

I would like to select the value column..

in site_tmplvar_contentvalues..

where contentid = 8 and tmplvarid = 1


Goal in "english"

I would like to select the value column.. in from site_tmplvar_contentvalues

where contentid = 8 and tmplvarid = 1


SELECT `value` FROM site_tmplvar_contentvalues WHERE contentid=8 and tmplvarid=1


I'm surprised you couldn't google/search SO for basic SQL syntax...

select `value`
from site_tmplvar_contentvalues
where contentid = 8 and tmplvarid = 1


A join is used to select values from more than one table. You have only one table here so the SQL would be

SELECT `value` 
FROM `site_tmplvar_contentvalues` 
WHERE contentid = 8 AND tmplvarid = 1

If you really need a join please give us some more information about the tables and the related fields in those tables.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜