2 Replies - 2157 Views - Last Post: 11 October 2012 - 12:29 PM

#1 wanabavbcoder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 08-October 12

how to use a Where Clause on two columns

Posted 09 October 2012 - 04:04 PM

The brick wall is that i have very very basic knowledge of sql. I am turning to the pros. :gun_bandana:

hi all, I have been advised by a vb.net coder that i have to use a where clause???
So I have no idea how it works and how to implement it.
Basically my table looks like this:

Venue_id [int 4 <pk that increments by 1>]
Venue_Name [char 30]
Venue_Address [nvarchar 50]
Venue_City [char 50]
Venue_State [char 50]
Venue_Zip_Code[int 4]
Venue_Capacity[numeric p]
Venue_Rent[nvarchar 8]
Venue_Contact_Person[char 50]
Venue_Contact_No[numeric 9]
Venue_Email[nvarchar 50<can contain null>]

But first I would like to check if the structure is okay.
So I need to query'using where' the venue_name and the rent.
I can use a parameter for the venue_name has been inserted from my vb code and then only display the venue_rent.

Is This A Good Question/Topic? 0
  • +

Replies To: how to use a Where Clause on two columns

#2 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 801
  • View blog
  • Posts: 1,700
  • Joined: 30-January 09

Re: how to use a Where Clause on two columns

Posted 10 October 2012 - 02:21 PM

Have you read any tutorials? A SELECT with a WHERE clause is about as simple as SQL gets. If you're having trouble with that, then you're going to have trouble with any DB interaction you do. I would strongly suggest going through a simple interactive tutorial so that you can pick up the basics, otherwise you'll have problems every time you need to do anything with the DB.

This post has been edited by e_i_pi: 10 October 2012 - 02:21 PM

Was This Post Helpful? 0
  • +
  • -

#3 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,174
  • Joined: 02-July 08

Re: how to use a Where Clause on two columns

Posted 11 October 2012 - 12:29 PM

And of course my favorite SQL resource. You basically need the And operator.

Select * From {table} Where 
{column1} {operator} {value} And
{column2} {operator} {value2}

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1