用于显示两个记录之间差异的SQL代码

时间:2016-08-20 12:10:53

标签: mysql sql

我对SQL语句有疑问。我希望我能够以正确的方式解释它,以便你能理解它。

我有一张表格,其中包括明文,描述,零售价和销售价格。现在我只需要显示零售价和销售价格之间的差异为150欧元的记录。

所以我开始认为我能做到吗? (是的,我是SQL新手)所以:

SELECT articlecode, description, retailprice, sellingprice  
FROM article 
WHERE retailprice (and here I do not know).

希望你能帮助我。

2 个答案:

答案 0 :(得分:0)

会是这样的:

SELECT articlecode, description, retailprice, sellingprice  
FROM article 
WHERE sellingprice-retailprice = 150

答案 1 :(得分:0)

尝试以下查询:

private async void onButtonClick(object sender, EventArgs e)
{
    await GetValuesAsync();
}

private async Task GetValuesAsync()
{   
    string ResponseJsonString = null;

    string url =
        "http://myWebapp.azurewebsites.net/api/values";

    using (var httpClient = new HttpClient())
    {
        try
        {
            Task<HttpResponseMessage> getResponse = httpClient.GetAsync(url);
            HttpResponseMessage response = await getResponse; //Execution hangs here forever ...
            ResponseJsonString = await response.Content.ReadAsStringAsync();
            values = JsonConvert.DeserializeObject<string[]>(ResponseJsonString);
        }
        catch (Exception ex)
        {

            throw;
        }
    }
}