Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 SELECT CHOOSE(custid % 4 + 1,

Author  Topic 

MelissaTsalicoglou
Starting Member

16 Posts

Posted - 2014-06-05 : 05:17:29
Hi All

Can someone please explain to me what the % 4 +1 means?
I cant understand that a custid would have a % in it ?

Please help me understand

SELECT CHOOSE(custid % 4 + 1, N'Group One', N'Group Two', N'Group Three', N'Group Four') AS segmentgroup, custid, contactname
FROM Sales.Customers;

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2014-06-05 : 05:48:14
% = modulo


Too old to Rock'n'Roll too young to die.
Go to Top of Page
   

- Advertisement -