Ugh, Easy SQL Question - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Ugh, Easy SQL Question

kellodykellody Posts: 11Member
It's been a long time since i've had to write a sql query and I forgot something.

I have a table. Let's pretend my table has the columns first_name, last_name, fav_Ice_cream

I want to do a simple select query
select * from persons
where name = "wanda"

except I only want to display the last_name and fav_ice_cream as my results (which later get pummeled into a dataset and datatable in VB.net). .

Any Ideas,
Thanks,
Kelly

Comments

  • JonathanJonathan Posts: 2,914Member
    : I have a table. Let's pretend my table has the columns first_name,
    : last_name, fav_Ice_cream
    :
    : I want to do a simple select query
    : select * from persons
    : where name = "wanda"
    :
    : except I only want to display the last_name and fav_ice_cream as my
    : results (which later get pummeled into a dataset and datatable in
    : VB.net). .
    Maybe you're looking for:-

    SELECT first_name, last_name, fav_Ice_cream
    FROM persons
    WHERE name = 'wanda'

    Perhaps?

    Jonathan

    ###
    # Example Of Perl 6 Syntax.
    push @will, my Power $button;
    my $hardware is Useless but Valuable;
    do ($nothing) while $i.work and print $stuff;
    push (@will, my Off $button) and die "with me";

  • raymcdraymcd Posts: 284Member
    : : I have a table. Let's pretend my table has the columns first_name,
    : : last_name, fav_Ice_cream
    : :
    : : I want to do a simple select query
    : : select * from persons
    : : where name = "wanda"
    : :
    : : except I only want to display the last_name and fav_ice_cream as my
    : : results (which later get pummeled into a dataset and datatable in
    : : VB.net). .
    : Maybe you're looking for:-
    :
    : SELECT first_name, last_name, fav_Ice_cream
    : FROM persons
    : WHERE name = 'wanda'
    :
    : Perhaps?
    :
    : Jonathan
    :
    : ###
    : # Example Of Perl 6 Syntax.
    : push @will, my Power $button;
    : my $hardware is Useless but Valuable;
    : do ($nothing) while $i.work and print $stuff;
    : push (@will, my Off $button) and die "with me";
    :
    :

    I think he is saying he wants to drop first_name... So SELECT last_name, fav_ice_cream FROM...

    It's a little unclear though...

    -ray
  • JonathanJonathan Posts: 2,914Member
    : I think he is saying he wants to drop first_name... So SELECT
    : last_name, fav_ice_cream FROM...
    :
    : It's a little unclear though...
    I agree with Ray now I've read the question properly. That'll teach me...sorry 'bout that. :-)

    Jonathan


    ###
    # Example Of Perl 6 Syntax.
    push @will, my Power $button;
    my $hardware is Useless but Valuable;
    do ($nothing) while $i.work and print $stuff;
    push (@will, my Off $button) and die "with me";

  • kellodykellody Posts: 11Member
    Thanks,
    I think my brain must of fogged over (it was Friday afternoon when I posted and the outside world was calling to me "kell-o-dy kell-ody")

    select favorite_icecream, last_name
    from blah
    where first_name = "wanda"

    Thanks For your help. .


Sign In or Register to comment.