Re: [2005] Which command?
The smart tags in VB2005 make it very easy to generate SQL statements. If you could give us a better idea of what you're after, then we can help you with a specific task...
Re: [2005] Which command?
Quote:
If you could give us a better idea of what you're after, then we can help you with a specific task...
Sorry I dont understand that phrase?
Re: [2005] Which command?
What exactly do you need to accomplish?
Re: [2005] Which command?
select count(ID2) from mytablename
Re: [2005] Which command?
i added that in picture:
I want to see in my datagrid view:
ID2* | Count of rows with ID2 | Count of rows with option=1 | Count of rows with option=2
* There are lots of ID2 values and I will use "DISTINCT" to see only one ID2 per 1 row
Command will be like this:
SELECT ID2 DISTINCT,Count(......),COUNT(.......),COUNT(.......) From Table
Re: [2005] Which command?
As for the other query:
select count(*) from tablename where option = 1
SQL's not complicated. I suggest you invest some time in a tutorial.
Re: [2005] Which command?
yeah I know w3school tutorials and I know that SQL is not complicated I learned it alone from that website but the code which you have written gives me only one integer. But I want rows...
SELECT ID2 DISTINCT,Count(......),COUNT(.......),COUNT(.......) From Table
in this code there are 4 columns. I cant use count function as a column how can I do that?
Re: [2005] Which command?
This shall be shown in Datagridview
ID2___Count_____ID2 with Option=1_____ID2 with Option=2
1_____5_________3___________________2
2_____4_________0___________________0
3_____6_________1___________________2
4_____4_________2___________________1
How to do this with SQL?
Re: [2005] Which command?
Re: [2005] Which command?
Writing SQL queries has nothing to do with VB.NET, even if they're being executed from a VB.NET application. SQL is database programming and therefore questions regarding it belong in the Database Development forum.