Solved

Select for sql 2008

Posted on 2011-09-09
4
242 Views
Last Modified: 2012-08-13
I need to select all data associated with a certain grower in sql.

I have farmer 1, farmer 2 and farmer 3

I ahve a column named contract_information_grower and need to select all data from the table that is associated with farmer 1.
0
Comment
Question by:HDM
  • 2
4 Comments
 

Author Comment

by:HDM
ID: 36514340
I also need to know how to take the decimals out of a number.

Right now it shows 9998.912

Would like it to show 9,999 when it shows up in excel.

Thanks!!

0
 
LVL 21

Accepted Solution

by:
JestersGrind earned 250 total points
ID: 36514366
You can use CEILING(YourColumn) to round the number up to the next whole number.

For your query:
select *
from yourtable
where contact_information_grower ='farmer 1'

Greg
0
 
LVL 4

Assisted Solution

by:AgeOfEmpires
AgeOfEmpires earned 250 total points
ID: 36514381
SELECT * FROM tablename WHERE contract_information_grower = 'farmer 1'

SELECT round(numberfield,0) FROM tablename
0
 

Author Closing Comment

by:HDM
ID: 36514424
Thanks!!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question