我有问题(我想有点问题),我希望,你会帮助我的.我使用Sybase Anywhere,这是我的代码:
SELECT TOP 4 Person.Id_person, Person.Name, Person.Surname, Visit.Date, Visit.Place
From Person, Visit
WHERE Visit.Id_person = Person.Id_person
ORDER BY Visit.DATE DESC
Run Code Online (Sandbox Code Playgroud)
这是结果:
3 | Paul | McDonald | 2010-01-19 | Ohio
3 | Paul | McDonald | 2010-01-18 | New York
19 | Ted | Malicky | 2009-12-24 | Tokyo
12 | Meg | Newton | 2009-10-13 | Warsaw
Run Code Online (Sandbox Code Playgroud)
我不想复制保罗麦克唐纳,并且只有第一次(按日期)访问.我想得到这样的结果:
3 | Paul | McDonald | 2010-01-19 | Ohio
19 | Ted | Malicky | 2009-12-24 | Tokyo
12 | …Run Code Online (Sandbox Code Playgroud) 我在编写从十六进制到二进制、十进制到二进制等的转换器时遇到问题。这是我的代码,当我调试它时,我收到错误“使用未分配的局部变量 Dec_Int10”,你能帮我吗?我该如何修复这个错误?
protected void Button_Click (object sender, Event Args e)
{
if (Page.IsValid)
{
int Dec_Int10;
if(!(string.IsNullOrEmpty(TextBox1.Text)))
{
Dec_Int10 = Convert.ToInt32(TextBox1.Text, 10)));
}
if(!(string.IsNullOrEmpty(TextBox2.Text)))
{
Dec_Int10 = Convert.ToInt32(TextBox2.Text, 16)));
}
if(!(string.IsNullOrEmpty(TextBox3.Text)))
{
Dec_Int10 = Convert.ToInt32(TextBox3.Text, 8)));
}
if(!(string.IsNullOrEmpty(TextBox4.Text)))
{
Dec_Int10 = Convert.ToInt32(TextBox4.Text, 2)));
}
string Dec_Str10 = Convert.ToString(Dec_Int10, 10);
string Hex_Str16 = Convert.ToString(Dec_Int10, 16);
string Oct_Str8 = Convert.ToString(Dec_Int10, 8);
string Bin_Str2 = Convert.ToString(Dec_Int10, 2);
TextBox1.Text = Dec_Str10;
TextBox2.Text = Hex_Str16;
TextBox3.Text = Oct_Str8;
TextBox4.Text = Bin_Str2;
}
}
Run Code Online (Sandbox Code Playgroud)