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

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.